Update formatter

This commit is contained in:
Fabian Hauser 2024-04-10 10:53:41 +07:00
parent 4eea2232fb
commit d8235cb2a9
55 changed files with 1031 additions and 664 deletions

View file

@ -1,7 +1,13 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
environment.systemPackages = with pkgs;
environment.systemPackages =
with pkgs;
[
vim
tmux
@ -25,8 +31,20 @@
units
powertop
lm_sensors
] ++ [ nixfmt nix-index nix-diff nixpkgs-review nixos-option ]
++ [ autojump powerline-go ] ++ [ # File Utilities
]
++ [
nixfmt
nix-index
nix-diff
nixpkgs-review
nixos-option
]
++ [
autojump
powerline-go
]
++ [
# File Utilities
ripgrep
unzip
p7zip
@ -40,7 +58,9 @@
vimPlugins.airline
git
git-lfs
] ++ [ # Filesystem & Disk Utilities
]
++ [
# Filesystem & Disk Utilities
exfat
samba
cifs-utils
@ -52,7 +72,9 @@
smartmontools
parted
usbutils
] ++ [ # Networking Utilities
]
++ [
# Networking Utilities
nmap
bind
curl
@ -68,5 +90,4 @@
imapsync
bluez-tools
];
}

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
users = {
@ -7,10 +12,15 @@ let
isNormalUser = true;
description = "Fabian Hauser";
group = "fhauser";
extraGroups =
[ "wheel" "video" "docker" "networkmanager" "libvirtd" "adbusers" ];
hashedPassword =
"$6$rounds=20000$TYZ8CojfBLwejcwn$smEJe6/anL9NGf.Ytfny14nBfhr4TRPv2XK1lgHz7yg.zQow1HACePirEjsjxzFC6vTHGaT8t2NxobUsHbWLg1";
extraGroups = [
"wheel"
"video"
"docker"
"networkmanager"
"libvirtd"
"adbusers"
];
hashedPassword = "$6$rounds=20000$TYZ8CojfBLwejcwn$smEJe6/anL9NGf.Ytfny14nBfhr4TRPv2XK1lgHz7yg.zQow1HACePirEjsjxzFC6vTHGaT8t2NxobUsHbWLg1";
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPF8ZV7vhpbVvLxiKq8ANVusNUHMbtii5MuvjxCbVz7vSNVPo9OOLvYyDqhbRAWMTdQeGZVAaALBufKKmprDTRFMpnA7Ut4TFrdz/5DTaR2KEjJ7P75moH+0xooR/GsbzFGsNBSQSXK3u1igndPYEC/PqCHN++32kDo2wLqTB4VLrEovU3iq8BMckn329Bu1fGbXKTgDpEvUEEwFO2brQZLMmzILGF/v4B9ImEGtinAUNgDSfEpgPN23sdWQH9rwEClGv95JmWNf05tuVomhZzOBtCFoAno3XB1nj16avjsqJ3aGFY2CCcfsNrwKzhIotmm82bcI4BJuJIVRIKbZ1 cardno:000603507108"
];
@ -22,18 +32,22 @@ let
description = "Testuser empty0";
group = "empty0";
extraGroups = [ "video" ];
hashedPassword =
"$6$mlI7Au.EzmrL9uJj$vz8ujechSkx83tsFcRA8D04vh5.3ZwPlPmE.wsf2CTKvLio48a1eXtRxUHkkDfPlLAjqyJ55bSSw2lLazH9Ip/";
hashedPassword = "$6$mlI7Au.EzmrL9uJj$vz8ujechSkx83tsFcRA8D04vh5.3ZwPlPmE.wsf2CTKvLio48a1eXtRxUHkkDfPlLAjqyJ55bSSw2lLazH9Ip/";
};
};
in {
imports = [ ../../modules ./unfree.nix ./applications.nix ./overlays.nix ];
in
{
imports = [
../../modules
./unfree.nix
./applications.nix
./overlays.nix
];
boot.loader.timeout = 2;
boot.tmp.useTmpfs = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
catppuccin.flavour = "mocha";
console.keyMap = "de_CH-latin1";
@ -46,17 +60,21 @@ in {
empty0.gid = 1003;
};
users.users = users // {
root.openssh.authorizedKeys.keys = with lib;
concatLists (mapAttrsToList (name: user:
if elem "wheel" user.extraGroups then
user.openssh.authorizedKeys.keys
else
[ ]) users);
root.openssh.authorizedKeys.keys =
with lib;
concatLists (
mapAttrsToList (
name: user: if elem "wheel" user.extraGroups then user.openssh.authorizedKeys.keys else [ ]
) users
);
};
# Package management
nix = {
settings.trusted-users = [ "root" "@wheel" ];
settings.trusted-users = [
"root"
"@wheel"
];
optimise.automatic = true;
gc = {
automatic = true;

View file

@ -1,4 +1,10 @@
{ config, lib, pkgs, options, ... }:
{
config,
lib,
pkgs,
options,
...
}:
{
nixpkgs.overlays = [ (import ../../overlays) ];

View file

@ -1,7 +1,13 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
nixpkgs.config.allowUnfreePredicate = pkg:
nixpkgs.config.allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"unrar"

View file

@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
@ -14,10 +19,12 @@
'';
# request-key expects a configuration file under /etc
environment.etc."request-key.conf" = {
text = let
text =
let
upcall = "${pkgs.cifs-utils}/bin/cifs.upcall";
keyctl = "${pkgs.keyutils}/bin/keyctl";
in ''
in
''
#OP TYPE DESCRIPTION CALLOUT_INFO PROGRAM
# -t is required for DFS share servers...
create cifs.spnego * * ${upcall} -t %k

View file

@ -1,4 +1,10 @@
{ config, pkgs, lib, ... }: {
{
config,
pkgs,
lib,
...
}:
{
imports = [
./desktop-environment.nix
@ -8,5 +14,4 @@
./security.nix
./video.nix
];
}

View file

@ -1,16 +1,29 @@
{ config, pkgs, lib, ... }:
let mkDefault = lib.mkDefault;
in {
{
config,
pkgs,
lib,
...
}:
let
mkDefault = lib.mkDefault;
in
{
environment.systemPackages = with pkgs;
[ # Utilities
environment.systemPackages =
with pkgs;
[
# Utilities
freetype
feh
lxappearance
sound-theme-freedesktop
] ++ [ # Networking
]
++ [
# Networking
gnome.networkmanager-openconnect
] ++ [ # Various
]
++ [
# Various
xfce.thunar
xfce.thunar-archive-plugin
xfce.xfce4-appfinder # xfce.thunar-volman # needed?
@ -79,5 +92,4 @@ in {
wlr.enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};
}

View file

@ -1,4 +1,10 @@
{ config, pkgs, lib, ... }: {
{
config,
pkgs,
lib,
...
}:
{
services.xserver.windowManager.i3.enable = true;

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
@ -44,5 +49,4 @@
programs.light.enable = true;
programs.adb.enable = true;
}

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
services.pcscd.enable = true;

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
#boot.kernelModules = [ "v4l2loopback" ];

View file

@ -1,4 +1,10 @@
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
let
thunderboltDevices = ''
THUNDERBOLT_DEVICES="$(${pkgs.pciutils}/bin/lspci -D | ${pkgs.gnugrep}/bin/grep -i thunderbolt | cut --delimiter=' ' --fields=1)"
@ -33,7 +39,8 @@ let
echo 'Done.'
'';
in {
in
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [
@ -47,7 +54,10 @@ in {
"igb"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" "uhid" ];
boot.kernelModules = [
"kvm-amd"
"uhid"
];
boot.extraModulePackages = [ ];
boot.kernelParams = [ "acpi_enforce_resources=lax" ];
@ -56,6 +66,5 @@ in {
hardware.cpu.amd.updateMicrocode = true;
nix.settings.max-jobs = lib.mkDefault 24;
powerManagement.powerUpCommands =
"${forceThunderboltOnScript}/bin/force-thunderbolt-power-on";
powerManagement.powerUpCommands = "${forceThunderboltOnScript}/bin/force-thunderbolt-power-on";
}

View file

@ -1,13 +1,18 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.loader.grub.extraConfig =
"\n serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1\n terminal_input serial\n terminal_output serial\n ";
boot.loader.grub.extraConfig = "\n serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1\n terminal_input serial\n terminal_output serial\n ";
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
@ -18,7 +23,11 @@
"sdhci_pci"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" "virtio" "tun" ];
boot.kernelModules = [
"kvm-amd"
"virtio"
"tun"
];
boot.extraModulePackages = [ ];
boot.kernelParams = [ "console=ttyS0,115200n8" ];

View file

@ -1,3 +1,12 @@
{ config, lib, pkgs, modulesPath, ... }: {
hardware.rasdaemon = { enable = true; };
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
hardware.rasdaemon = {
enable = true;
};
}

View file

@ -1,4 +1,12 @@
{ config, lib, pkgs, modulesPath, hardwareModules, ... }: {
{
config,
lib,
pkgs,
modulesPath,
hardwareModules,
...
}:
{
imports = with hardwareModules; [
(modulesPath + "/installer/scan/not-detected.nix")
@ -22,8 +30,7 @@
# Ignore Alcor smartcard (gpg is not very smart)
# See https://ludovicrousseau.blogspot.com/2015/12/remove-andor-customize-pcsc-reader-names.html
systemd.services.pcscd.environment.PCSCLITE_FILTER_IGNORE_READER_NAMES =
"Alcor";
systemd.services.pcscd.environment.PCSCLITE_FILTER_IGNORE_READER_NAMES = "Alcor";
#hardware.video.hidpi.enable = true;

View file

@ -1,18 +1,36 @@
{ config, lib, pkgs, modulesPath, hardwareModules, pkgFccUnlock, ... }: {
{
config,
lib,
pkgs,
modulesPath,
hardwareModules,
pkgFccUnlock,
...
}:
{
imports = with hardwareModules; [
(modulesPath + "/installer/scan/not-detected.nix")
hardwareModules.lenovo-thinkpad-x1-9th-gen
];
boot.initrd.availableKernelModules =
[ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" "ahci" "usbhid" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"thunderbolt"
"nvme"
"usb_storage"
"sd_mod"
"ahci"
"usbhid"
];
boot.kernelModules = [ "kvm-intel" ];
boot.initrd.kernelModules =
[ "dm-snapshot" ]; # TODO: This should be moved to defaults
boot.initrd.kernelModules = [ "dm-snapshot" ]; # TODO: This should be moved to defaults
environment.systemPackages = with pkgs; [ modemmanager libmbim ];
environment.systemPackages = with pkgs; [
modemmanager
libmbim
];
environment.etc."ModemManager/fcc-unlock.d/1eac:1001" = {
source = "${pkgFccUnlock}/bin/fcc-unlock";

View file

@ -1,9 +1,19 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
services.printing = {
enable = true;
drivers = with pkgs; [ gutenprint hplip splix cups-googlecloudprint ];
drivers = with pkgs; [
gutenprint
hplip
splix
cups-googlecloudprint
];
};
services.system-config-printer.enable = true;

View file

@ -15,34 +15,39 @@
url = "git+file:///etc/nixos/fcc-unlock";
inputs.nixos-stable.follows = "nixpkgs-stable";
};
};
outputs = { self, nixpkgs-unstable, nixpkgs-stable, home-manager
, nixos-hardware, fcc-unlock, catppuccin, ... }@inputs:
outputs =
{
self,
nixpkgs-unstable,
nixpkgs-stable,
home-manager,
nixos-hardware,
fcc-unlock,
catppuccin,
...
}@inputs:
let
system = "x86_64-linux";
pkgsUnstable = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true; # For vscode
};
hosts = [ "speer" "hummelberg" "ochsenchopf" ];
in {
checks.${system}.formatCheck = let pkgs = pkgsUnstable;
in pkgs.runCommand "nixfmt-check" { } ''
set -euo pipefail
cd ${self}
${self.apps.${system}.format.program} --check
mkdir $out
'';
hosts = [
"speer"
"hummelberg"
"ochsenchopf"
];
in
{
# Build with `nixos-rebuild --flake .#<hostname>` or
# `nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel
nixosConfigurations = let
nixosConfigurations =
let
sharedSpecialArgs = {
inherit pkgsUnstable;
pkgFccUnlock = fcc-unlock.packages.${system}.default;
};
home-manager-config = {
home-manager = {
@ -55,7 +60,8 @@
];
};
};
mapHostnameToAttr = host:
mapHostnameToAttr =
host:
nixpkgs-stable.lib.nixosSystem {
inherit system;
specialArgs = sharedSpecialArgs // {
@ -67,31 +73,21 @@
./host/${host}/default.nix
] ++ (if host == "bachtel" then [ ] else [ home-manager-config ]);
};
in pkgsUnstable.lib.genAttrs hosts mapHostnameToAttr;
in
pkgsUnstable.lib.genAttrs hosts mapHostnameToAttr;
# Nix development shell
devShells.${system}.default = import ./shell.nix { pkgs = pkgsUnstable; };
# Run checks and build all hosts as default package
packages.${system}.default = with pkgsUnstable.lib;
packages.${system}.default =
with pkgsUnstable.lib;
let
checks = attrValues self.checks.${system};
nixosConfigs = mapAttrsToList (n: v: v.config.system.build.toplevel)
self.nixosConfigurations;
in pkgsUnstable.linkFarmFromDrvs "allHosts" (checks ++ nixosConfigs);
nixosConfigs = mapAttrsToList (n: v: v.config.system.build.toplevel) self.nixosConfigurations;
in
pkgsUnstable.linkFarmFromDrvs "allHosts" (checks ++ nixosConfigs);
apps.${system} = {
# Execute nixfmt on the repository
format = let
pkgs = pkgsUnstable;
formatter = pkgsUnstable.writeShellScriptBin "formatter" ''
${pkgs.findutils}/bin/find . -type f -name '*.nix' -exec ${pkgs.nixfmt}/bin/nixfmt $@ {} +
'';
in {
type = "app";
program = "${formatter}/bin/formatter";
};
};
formatter.${system} = pkgsUnstable.nixfmt-rfc-style;
};
}

View file

@ -1,3 +1,4 @@
{ pkgs, lib, ... }: {
{ pkgs, lib, ... }:
{
catppuccin.flavour = "mocha";
}

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
@ -34,15 +39,23 @@
};
home = {
sessionVariables = { NIXOS_OZONE_WL = "1"; };
packages = with pkgs;
[ # Networking
sessionVariables = {
NIXOS_OZONE_WL = "1";
};
packages =
with pkgs;
[
# Networking
transmission # GUI Tools, maybe extract...
] ++ [ # Desktop Environment Applications
]
++ [
# Desktop Environment Applications
google-chrome
chromium
nextcloud-client
] ++ [ # office
]
++ [
# office
calibre
libreoffice-fresh # TODO: Dictionaries, nixos/nixpkgs#14430
tectonic
@ -52,14 +65,18 @@
pkgs.gnome-online-accounts
gnome.gnome-control-center
todoist-electron
] ++ [ # Communication
]
++ [
# Communication
#TODO: ekiga?
jitsi-meet-electron
teamviewer
rdesktop
#davinci-resolve
lightworks
] ++ [ # Development
]
++ [
# Development
vscodium
virt-manager
modemmanager # TODO: makes sense here?
@ -67,8 +84,7 @@
];
#TODO: Write module
activation.statefulConfigSymlinks =
config.lib.dag.entryAfter [ "writeBoundary" ] ''
activation.statefulConfigSymlinks = config.lib.dag.entryAfter [ "writeBoundary" ] ''
set -eo pipefail
STATEFUL_ROOT="$HOME/.stateful"

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: {
dconf.settings."org/gnome/evolution-data-server/calendar".notify-enable-audio =
false;
{ pkgs, ... }:
{
dconf.settings."org/gnome/evolution-data-server/calendar".notify-enable-audio = false;
}

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
programs.firefox = {
enable = true;
package = pkgs.firefox;

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
services.gammastep = {
enable = true;
settings.general.brightness-night = "0.9";

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
programs.git = {
enable = true;
package = pkgs.gitAndTools.gitFull;
@ -6,8 +7,7 @@
s = "status --short --branch";
a = "add --patch";
c = "commit --message";
l =
"log --color --graph --pretty=format:'%Cred%h%Creset - %C(bold)%s%Creset%C(yellow)%d%Creset %C(green)%an%Creset %C(cyan)%cr%Creset (S: %G?)' --abbrev-commit";
l = "log --color --graph --pretty=format:'%Cred%h%Creset - %C(bold)%s%Creset%C(yellow)%d%Creset %C(green)%an%Creset %C(cyan)%cr%Creset (S: %G?)' --abbrev-commit";
d = "diff";
fup = "commit --fixup";
@ -57,10 +57,16 @@
rerere.enabled = true;
fetch.recurseSubmodules = "on-demand";
};
ignores = [ "*~" "*.swp" ".direnv/" ];
ignores = [
"*~"
"*.swp"
".direnv/"
];
lfs.enable = true;
includes = let
mkConfig = (dir: {
includes =
let
mkConfig = (
dir: {
condition = "gitdir:${dir}";
contents = {
user = {
@ -69,8 +75,10 @@
name = "Fabian Hauser";
};
};
});
in map mkConfig [
}
);
in
map mkConfig [
"~/private/"
"/etc/nixos/"
"~/.password-store/"

View file

@ -1,4 +1,5 @@
{ pkgs, pkgsUnstable, ... }: {
{ pkgs, pkgsUnstable, ... }:
{
#TODO: ENV variabls for agent
programs.gpg = {
enable = true;
@ -14,8 +15,7 @@
"personal-cipher-preferences" = "AES256 AES192 AES CAST5";
"cert-digest-algo" = "SHA512";
"personal-digest-preferences" = "SHA512 SHA384 SHA256 SHA224";
"default-preference-list" =
"SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed";
"default-preference-list" = "SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed";
"display-charset" = "utf-8";
"fixed-list-mode" = true;
"with-fingerprint" = true;
@ -23,7 +23,9 @@
"verify-options" = "show-uid-validity";
"list-options" = "show-uid-validity";
};
scdaemonSettings = { disable-ccid = true; };
scdaemonSettings = {
disable-ccid = true;
};
# TODO: Complete this list and maybe transfer to managed configuration?
#publicKeys = [
# { source = "./fabian.hauser@qo.is.pub"; trust = 5; }
@ -36,7 +38,8 @@
enableSshSupport = true;
enableExtraSocket = true;
# TODO: pinentryPackage =
extraConfig = let
extraConfig =
let
pinentryBemenu = pkgs.writeShellApplication {
name = "pinentry-bemenu-with-env";
text = ''
@ -44,7 +47,8 @@
"${pkgs.pinentry-bemenu}/bin/pinentry-bemenu" "$@"
'';
};
in ''
in
''
pinentry-program ${pinentryBemenu}/bin/pinentry-bemenu-with-env
'';
sshKeys = [

View file

@ -1,76 +1,108 @@
{ pkgs, lib, config, ... }: {
{
pkgs,
lib,
config,
...
}:
{
# systemd.user.services.kanshi.Install.WantedBy = "home-manager-fhauser.service"; # TODO: Upstream array type of systemdTarget
services.kanshi = {
enable = true;
profiles = let
profiles =
let
backgroundPicturePath = "~/pictures/backgrounds";
backgroundCommand = ''
#swaymsg "output * bg `find ${backgroundPicturePath} -type f | shuf -n 1` fill"
'';
mkScreen = (screen: {
mkScreen = (
screen: {
criteria = screen;
status = "enable";
scale = 1.0;
});
}
);
homeDellScreen = "Dell Inc. DELL P2720DC 22JPK53";
p14sScreen = "BOE 0x08CE Unknown";
in rec {
in
rec {
#mobile-work.exec = backgroundCommand;
mobile-work.outputs = [
(mkScreen p14sScreen // {
(
mkScreen p14sScreen
// {
position = "0,0";
scale = 2.0;
})
}
)
];
mobile-work-external.outputs = [
(mkScreen p14sScreen // {
(
mkScreen p14sScreen
// {
position = "1920,0";
scale = 2.0;
})
}
)
(mkScreen "Lenovo Group Limited M14 V907R2HD" // { position = "0,0"; })
];
mobile-private.outputs = [
(mkScreen "Unknown 0x1536 0x00000000" // {
(
mkScreen "Unknown 0x1536 0x00000000"
// {
position = "0,0";
scale = 1.5;
})
}
)
];
home-dock.outputs = mobile-work.outputs ++ [
(mkScreen homeDellScreen // {
(
mkScreen homeDellScreen
// {
position = "1920,0";
scale = 1.0;
status = "enable";
})
}
)
];
office-dock.outputs = [
(mkScreen "Dell Inc. DELL P2720DC BRKPK53" // { position = "0,0"; })
(mkScreen "Dell Inc. DELL P2720DC 6JRRK53" // { position = "2560,0"; })
(mkScreen p14sScreen // {
(
mkScreen p14sScreen
// {
position = "5120,0";
scale = 2.0;
})
}
)
];
office-cyrille-dock.outputs = [
(mkScreen "Acer Technologies Acer PE270K 0x0000B784" // {
(
mkScreen "Acer Technologies Acer PE270K 0x0000B784"
// {
position = "0,0";
scale = 1.5;
})
(mkScreen p14sScreen // {
}
)
(
mkScreen p14sScreen
// {
position = "2560,0";
scale = 2.0;
})
}
)
];
home-pc.outputs = [
(mkScreen homeDellScreen // { position = "0,0"; })
(mkScreen "HP Inc. HP Z27 CN482201RP" // {
(
mkScreen "HP Inc. HP Z27 CN482201RP"
// {
position = "2560,0";
scale = 1.5;
})
}
)
];
home-pc-row.outputs = home-pc.outputs ++ [
(mkScreen "Eizo Nanao Corporation EV2450 92395086" // {
position = "5120,0";
})
(mkScreen "Eizo Nanao Corporation EV2450 92395086" // { position = "5120,0"; })
];
};
};

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
programs.kitty = {
enable = true;
catppuccin.enable = true;

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
services.mako = {
enable = true;
catppuccin.enable = true;

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
home.file.".psqlrc".text = ''
\set QUIET 1
@ -17,5 +18,4 @@
\unset QUIET
\conninfo
'';
}

View file

@ -30,4 +30,10 @@ let
password_value=$(${pkgs.pass-wayland}/bin/pass show "$password" | tail -1 2>/dev/null)
${pkgs.wtype}/bin/wtype "''${password_value}"
'';
in { home.packages = [ passbemenu suspend ]; }
in
{
home.packages = [
passbemenu
suspend
];
}

View file

@ -1,8 +1,14 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
programs = {
bash = {
enable = true;
historyIgnore = [ "ls" "cd" "exit" "j" ];
historyIgnore = [
"ls"
"cd"
"exit"
"j"
];
shellAliases = {
# Sane defaults
l = "ls -lah";
@ -14,13 +20,10 @@
ack = "rg";
# Git helpers
git-fetch-pr =
"git config --add remote.origin.fetch '+refs/pull/*/head:refs/remotes/origin/pr/*'";
git-config-fetchall = ''
git config --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*"'';
git-fetch-pr = "git config --add remote.origin.fetch '+refs/pull/*/head:refs/remotes/origin/pr/*'";
git-config-fetchall = ''git config --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*"'';
git-enable-signing =
"git config commit.gpgsign true && git config tag.gpgsign true";
git-enable-signing = "git config commit.gpgsign true && git config tag.gpgsign true";
# Common Typos
gits = "git s";
};
@ -29,7 +32,13 @@
xdg-open "$*" >/dev/null 2>&1 &
}
'';
shellOptions = [ "autocd" "checkjobs" "dotglob" "globstar" "histappend" ];
shellOptions = [
"autocd"
"checkjobs"
"dotglob"
"globstar"
"histappend"
];
sessionVariables = {
#TODO: Some of these should be migrated to the according application.
GPG_TTY = "$(tty)";

View file

@ -1,25 +1,34 @@
{ pkgs, lib, ... }: {
programs.ssh = let
{ pkgs, lib, ... }:
{
programs.ssh =
let
forceIdentityThreema = {
identityFile = toString (pkgs.writeText "fabian.hauser@threema.ch.pub" ''
identityFile = toString (
pkgs.writeText "fabian.hauser@threema.ch.pub" ''
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO7h492sXT7zdamf+nbOt+y6jiqxicOnm6+wiuEG1EvZ openpgp:0x18B553DD
'');
''
);
identitiesOnly = true;
};
forceIdentityPrivate = {
identityFile = toString (pkgs.writeText "fabian.hauser@qo.is.pub" ''
identityFile = toString (
pkgs.writeText "fabian.hauser@qo.is.pub" ''
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIPF8ZV7vhpbVvLxiKq8ANVusNUHMbtii5MuvjxCbVz7vSNVPo9OOLvYyDqhbRAWMTdQeGZVAaALBufKKmprDTRFMpnA7Ut4TFrdz/5DTaR2KEjJ7P75moH+0xooR/GsbzFGsNBSQSXK3u1igndPYEC/PqCHN++32kDo2wLqTB4VLrEovU3iq8BMckn329Bu1fGbXKTgDpEvUEEwFO2brQZLMmzILGF/v4B9ImEGtinAUNgDSfEpgPN23sdWQH9rwEClGv95JmWNf05tuVomhZzOBtCFoAno3XB1nj16avjsqJ3aGFY2CCcfsNrwKzhIotmm82bcI4BJuJIVRIKbZ1 cardno:000610954665
'');
''
);
identitiesOnly = true;
};
in {
in
{
enable = true;
matchBlocks = {
"work.github.com" = forceIdentityThreema // {
hostname = "github.com";
user = "git";
};
"github.com" = forceIdentityPrivate // { user = "git"; };
"github.com" = forceIdentityPrivate // {
user = "git";
};
};
extraConfig = ''
IdentityAgent /run/user/1000/gnupg/S.gpg-agent.ssh

View file

@ -1,4 +1,9 @@
{ pkgs, lib, config, ... }:
{
pkgs,
lib,
config,
...
}:
let
adhereTheSwayTarget = {
Install.WantedBy = lib.mkForce [ "sway-session.target" ];
@ -13,7 +18,8 @@ let
${pkgs.bemenu}/bin/bemenu --list 20 --ignorecase --prompt 'Start: ' | \
xargs swaymsg exec --
'';
in rec {
in
rec {
home.packages = with pkgs; [
sway-contrib.grimshot
wl-clipboard
@ -30,7 +36,9 @@ in rec {
enable = true;
systemd.enable = true;
xwayland = true;
wrapperFeatures = { gtk = true; };
wrapperFeatures = {
gtk = true;
};
catppuccin.enable = true;
extraSessionCommands = ''
#export XDG_CURRENT_DESKTOP=Unity
@ -49,7 +57,9 @@ in rec {
xkb_layout = "ch,de";
xkb_options = "eurosign:e";
};
"*" = { xkb_numlock = "enable"; };
"*" = {
xkb_numlock = "enable";
};
};
terminal = "${pkgs.kitty}/bin/kitty";
menu = "${bemenuLauncher}/bin/bemenuLauncher";
@ -60,24 +70,27 @@ in rec {
#TODO: Workspace Programm assignment: Not working properly
assigns = {
"10" = [{ app_id = "^firefox$"; }];
"11" = [{ app_id = "^(claws-mail|thunderbird|evolution)$"; }];
"12" = [{
"10" = [ { app_id = "^firefox$"; } ];
"11" = [ { app_id = "^(claws-mail|thunderbird|evolution)$"; } ];
"12" = [
{
class = "^Chromium-browser$";
instance = "^web.threema.ch";
}];
"13" = [{ class = "^Spotify$"; }];
}
];
"13" = [ { class = "^Spotify$"; } ];
};
keybindings = let
keybindings =
let
mod = wayland.windowManager.sway.config.modifier;
playerctl = "${pkgs.playerctl}/bin/playerctl";
wpctl = "${pkgs.wireplumber}/bin/wpctl";
light = "${pkgs.light}/bin/light";
in lib.mkOptionDefault {
in
lib.mkOptionDefault {
"${mod}+p" = "exec passbemenu";
"${mod}+Shift+d" =
"exec ${pkgs.rofimoji}/bin/rofimoji --action type --selector fuzzel";
"${mod}+Shift+d" = "exec ${pkgs.rofimoji}/bin/rofimoji --action type --selector fuzzel";
"${mod}+x" = "move workspace to output right";
"${mod}+y" = "move workspace to output left";
@ -99,13 +112,10 @@ in rec {
"Ctrl+mod1+Shift+L" = "exec ${pkgs.systemd}/bin/systemctl suspend";
# pulse audio volume control
XF86AudioLowerVolume =
"exec ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 3%-";
XF86AudioRaiseVolume =
"exec ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 3%+";
XF86AudioLowerVolume = "exec ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 3%-";
XF86AudioRaiseVolume = "exec ${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 3%+";
XF86AudioMute = "exec ${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle";
XF86AudioMicMute =
"exec ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
XF86AudioMicMute = "exec ${wpctl} set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
# Spotify control
XF86AudioPause = "exec ${playerctl} play-pause";
@ -137,8 +147,7 @@ in rec {
Unit.After = lib.mkForce [ "waybar.service" ];
Service = {
ExecStartPre = "${pkgs.coreutils}/bin/sleep 3";
Environment = lib.mkForce
"PATH=${config.home.profileDirectory}/bin XDG_CURRENT_DESKTOP=Unity";
Environment = lib.mkForce "PATH=${config.home.profileDirectory}/bin XDG_CURRENT_DESKTOP=Unity";
};
};
systemd.user.services.owncloud-client = adhereTheSwayTarget // {
@ -146,8 +155,7 @@ in rec {
Unit.After = lib.mkForce [ "waybar.service" ];
Service = {
ExecStartPre = "${pkgs.coreutils}/bin/sleep 3";
Environment = lib.mkForce
"PATH=${config.home.profileDirectory}/bin XDG_CURRENT_DESKTOP=Unity";
Environment = lib.mkForce "PATH=${config.home.profileDirectory}/bin XDG_CURRENT_DESKTOP=Unity";
};
};
systemd.user.services.pasystray = adhereTheSwayTarget;
@ -163,5 +171,7 @@ in rec {
catppuccin.enable = true;
};
dconf.settings = { "org/gnome/desktop/interface".menus-have-icons = true; };
dconf.settings = {
"org/gnome/desktop/interface".menus-have-icons = true;
};
}

View file

@ -1,14 +1,15 @@
{ pkgs, ... }: {
systemd.user.services.swayidle = let
lock =
"${pkgs.swaylock}/bin/swaylock --hide-keyboard-layout --ignore-empty-password --daemonize --show-failed-attempts --color=000000";
{ pkgs, ... }:
{
systemd.user.services.swayidle =
let
lock = "${pkgs.swaylock}/bin/swaylock --hide-keyboard-layout --ignore-empty-password --daemonize --show-failed-attempts --color=000000";
logTimeCmd = "${pkgs.coreutils}/bin/date --rfc-3339=seconds >> ~/locklog";
idleCmd = (action:
''${pkgs.sway}/bin/swaymsg "output * dpms ${action}" && ${logTimeCmd}'');
idleCmd = (action: ''${pkgs.sway}/bin/swaymsg "output * dpms ${action}" && ${logTimeCmd}'');
timeout-screens-off = 600;
timeout-lock = 630;
timeout-suspend = 1800;
in {
in
{
Unit = {
Description = "Idle Manager for Wayland";
Documentation = [ "man:swayidle(1)" ];
@ -21,14 +22,14 @@
timeout ${toString timeout-lock} '${lock}' \
timeout ${toString timeout-screens-off} '${idleCmd "off"}' \
resume '${idleCmd "on"}' \
timeout ${
toString timeout-suspend
} '${pkgs.systemd}/bin/systemctl suspend' \
timeout ${toString timeout-suspend} '${pkgs.systemd}/bin/systemctl suspend' \
lock '${lock}' \
before-sleep '${lock}';
''; # TODO: Make this configurable and add home-manager module. (Requires sway with systemd-target support)
};
Install = { WantedBy = [ "sway-session.target" ]; };
Install = {
WantedBy = [ "sway-session.target" ];
};
};
programs.swaylock.catppuccin.enable = true;

View file

@ -1,4 +1,5 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
programs.neovim = {
enable = true;
defaultEditor = true;
@ -50,6 +51,9 @@
filetype plugin indent on
syntax on
'';
plugins = with pkgs.vimPlugins; [ vim-sensible vim-airline ];
plugins = with pkgs.vimPlugins; [
vim-sensible
vim-airline
];
};
}

View file

@ -1,4 +1,10 @@
{ pkgs, lib, config, ... }: {
{
pkgs,
lib,
config,
...
}:
{
xsession.preferStatusNotifierItems = true;
wayland.windowManager.sway.config.bars = [ ];
@ -8,10 +14,14 @@
enable = true;
target = "tray.target";
};
settings = [{
settings = [
{
position = "top";
#height =
modules-left = [ "sway/mode" "sway/workspaces" ];
modules-left = [
"sway/mode"
"sway/workspaces"
];
modules-center = [ "sway/window" ];
modules-right = [
"idle_inhibitor"
@ -68,8 +78,7 @@
};
"sway/mode" = {
format =
''<span style="italic"> {}</span>''; # Icon: expand-arrows-alt
format = ''<span style="italic"> {}</span>''; # Icon: expand-arrows-alt
tooltip = "false";
};
@ -102,7 +111,11 @@
phone = "";
portable = "";
car = "";
default = [ "" "" "" ];
default = [
""
""
""
];
};
on-click = "pavucontrol";
};
@ -119,7 +132,8 @@
icon-size = "21";
spacing = "10";
};
}];
}
];
style = ''
/* =============================================================================

View file

@ -1,7 +1,8 @@
{ pkgs, ... }:
let
web-app = name: url:
web-app =
name: url:
pkgs.writeScriptBin name ''
#!${pkgs.stdenv.shell}
exec ${pkgs.chromium}/bin/chromium --user-data-dir=$HOME/.config/chromium-app-${name} --app="${url}"
@ -11,6 +12,13 @@ let
threema-work = web-app "threema-work" "https://web-beta.threema.ch/";
threema-red = web-app "threema-red" "https://web-work-staging.threema.ch/";
threema-tickets = web-app "threema-tickets" "https://ticket.threema.ch/scp/";
in {
home.packages = [ whatsapp threema threema-work threema-red threema-tickets ];
in
{
home.packages = [
whatsapp
threema
threema-work
threema-red
threema-tickets
];
}

View file

@ -1,4 +1,11 @@
{ config, pkgs, lib, nixosConfig, ... }: {
{
config,
pkgs,
lib,
nixosConfig,
...
}:
{
imports = [
./multimedia.nix
./applications

View file

@ -1,9 +1,24 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
home.packages = with pkgs;
[ neverball wesnoth pingus superTux superTuxKart extremetuxracer zeroad ]
++ (with pkgs.gnome; [ # Selection of gnome games
home.packages =
with pkgs;
[
neverball
wesnoth
pingus
superTux
superTuxKart
extremetuxracer
zeroad
]
++ (with pkgs.gnome; [
# Selection of gnome games
five-or-more
four-in-a-row
gnome-chess

View file

@ -1,22 +1,33 @@
{ pkgs, lib, config, ... }: {
{
pkgs,
lib,
config,
...
}:
{
xdg.mimeApps = rec {
enable = true;
associations.added = defaultApplications;
defaultApplications = let
defaultApplications =
let
browser = [ "firefox.desktop" ];
email = [ "org.gnome.Evolution.desktop" ];
doc-editor = [ "writer.desktop" ];
sheet-editor = [ "calc.desktop" ];
presentation-editor = [ "impress.desktop" ];
pdf = [ "org.gnome.Evince.desktop" ];
image = [ "org.gnome.Loupe.desktop" "gimp.desktop" ];
image = [
"org.gnome.Loupe.desktop"
"gimp.desktop"
];
image-vector = [ "org.inkscape.Inkscape.desktop" ];
ebooks = [ "calibre-ebook-viewer.desktop" ];
code-general = [ "codium.desktop" ];
video = [ "mpv.desktop" ];
compression = [ "org.gnome.Nautilus.desktop" ];
in {
in
{
"text/html" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
@ -31,12 +42,9 @@
"text/calendar" = email;
"application/vnd.oasis.opendocument.text" = doc-editor;
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" =
doc-editor;
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" =
sheet-editor;
"application/vnd.openxmlformats-officedocument.presentationml.presentation" =
presentation-editor;
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" = doc-editor;
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" = sheet-editor;
"application/vnd.openxmlformats-officedocument.presentationml.presentation" = presentation-editor;
"application/vnd.oasis.opendocument.presentation" = presentation-editor;
"application/pdf" = pdf;
"application/x-extension-pdf" = pdf;

View file

@ -1,4 +1,9 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
{
@ -12,8 +17,16 @@
profile = "gpu-hq";
};
};
home.packages = with pkgs;
[ vlc v4l-utils playerctl yt-dlp ] ++ [ # Audio
home.packages =
with pkgs;
[
vlc
v4l-utils
playerctl
yt-dlp
]
++ [
# Audio
gnome.gnome-sound-recorder
enblend-enfuse
ffmpeg
@ -29,7 +42,9 @@
pasystray
pavucontrol
spotify
] ++ [ # Imaging
]
++ [
# Imaging
gimp
hugin
lensfun
@ -39,7 +54,9 @@
# ImageMagick-perl perl-File-Type perl-Term-ProgressBar #TODO: Support libraries for scripts
inkscape
ghostscript
] ++ [ # Codecs for Audio and Video
]
++ [
# Codecs for Audio and Video
vobcopy
libdv
libdvbpsi # TODO: librtmp?
@ -54,5 +71,4 @@
gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-ugly
];
}

View file

@ -1,4 +1,5 @@
{ config, pkgs, ... }: {
{ config, pkgs, ... }:
{
imports = [
./filesystems.nix
@ -16,7 +17,8 @@
#TODO: Clean up next section
services.xserver.dpi = 180;
virtualisation = { # TODO: This should probably be somewhere else.
virtualisation = {
# TODO: This should probably be somewhere else.
docker = {
enable = true;
enableOnBoot = false;

View file

@ -1,4 +1,10 @@
{ config, pkgs, lib, ... }: {
{
config,
pkgs,
lib,
...
}:
{
boot.initrd.luks.devices = {
"root".device = "/dev/disk/by-uuid/fae1b81e-894c-47b4-92e5-0a817fd6f66f";
"swap".device = "/dev/disk/by-uuid/dc1fe9ff-7eb7-40c3-8fbd-d99398e5e5d6";
@ -21,10 +27,9 @@
};
};
swapDevices = [{ device = "/dev/mapper/swap"; }];
swapDevices = [ { device = "/dev/mapper/swap"; } ];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
}

View file

@ -2,7 +2,8 @@
{
hardware.printers.ensureDefaultPrinter = "hsr-mfp-8261";
hardware.printers.ensurePrinters = [{
hardware.printers.ensurePrinters = [
{
name = "hsr-mfp-8261";
deviceUri = "smb://hsr.ch/printsrv-d.hsr.ch/d8261-a4mfp";
location = "HSR 8.261";
@ -12,5 +13,6 @@
PageSize = "A4";
auth-info-required = "username,password";
};
}];
}
];
}

View file

@ -1,4 +1,5 @@
{ config, pkgs, ... }: {
{ config, pkgs, ... }:
{
imports = [
./filesystems.nix
@ -11,7 +12,8 @@
../../defaults/desktop
];
virtualisation = { # TODO: This should probably be somewhere else.
virtualisation = {
# TODO: This should probably be somewhere else.
docker = {
enable = true;
enableOnBoot = false;
@ -38,5 +40,4 @@
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
}

View file

@ -1,9 +1,20 @@
{ config, pkgs, lib, ... }: {
{
config,
pkgs,
lib,
...
}:
{
boot.initrd.luks.devices = { "luks".device = "/dev/disk/by-label/luks"; };
boot.initrd.luks.devices = {
"luks".device = "/dev/disk/by-label/luks";
};
fileSystems = let rootdev = "/dev/disk/by-label/hv_ochsenchopf";
in {
fileSystems =
let
rootdev = "/dev/disk/by-label/hv_ochsenchopf";
in
{
"/" = {
device = rootdev;
fsType = "btrfs";
@ -20,10 +31,9 @@
};
};
swapDevices = [{ device = "/dev/disk/by-label/swap"; }];
swapDevices = [ { device = "/dev/disk/by-label/swap"; } ];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
}

View file

@ -1,4 +1,5 @@
{ config, pkgs, ... }: {
{ config, pkgs, ... }:
{
imports = [
./filesystems.nix
@ -14,7 +15,8 @@
#../../defaults/printing
];
virtualisation = { # TODO: This should probably be somewhere else.
virtualisation = {
# TODO: This should probably be somewhere else.
docker = {
enable = true;
enableOnBoot = false;
@ -32,5 +34,4 @@
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment?
}

View file

@ -1,6 +1,11 @@
{ config, pkgs, lib, ... }: {
boot.initrd.luks.devices.system.device =
"/dev/disk/by-uuid/bf353bb1-43bf-453f-ae7e-0fa9b4d8778c";
{
config,
pkgs,
lib,
...
}:
{
boot.initrd.luks.devices.system.device = "/dev/disk/by-uuid/bf353bb1-43bf-453f-ae7e-0fa9b4d8778c";
boot.initrd.kernelModules = [ "dm-snapshot" ];
fileSystems = {

View file

@ -1,4 +1,5 @@
{ config, pkgs, ... }: {
{ config, pkgs, ... }:
{
networking = {
networkmanager.enable = true;
useDHCP = false;

View file

@ -2,7 +2,8 @@
{
hardware.printers.ensureDefaultPrinter = "hsr-mfp-8261";
hardware.printers.ensurePrinters = [{
hardware.printers.ensurePrinters = [
{
name = "hsr-mfp-8261";
deviceUri = "smb://hsr.ch/printsrv-d.hsr.ch/d8261-a4mfp";
location = "HSR 8.261";
@ -12,5 +13,6 @@
PageSize = "A4";
auth-info-required = "username,password";
};
}];
}
];
}

View file

@ -1,5 +1,5 @@
{ config, pkgs, ... }: {
{ config, pkgs, ... }:
{
imports = [ ];
}

View file

@ -3,5 +3,6 @@ with super.lib;
let
# Load the system wide overlays
overlays = (import <nixpkgs/nixos> { }).config.nixpkgs.overlays;
# Apply all overlays to the input of the current "main" overlay
in foldl' (flip extends) (_: super) overlays self
in
# Apply all overlays to the input of the current "main" overlay
foldl' (flip extends) (_: super) overlays self

View file

@ -1,4 +1,3 @@
self: super:
{
self: super: {
}

View file

@ -1,12 +1,20 @@
{ pkgs ? import <nixpkgs-unstable> { } }:
{
pkgs ? import <nixpkgs-unstable> { },
}:
pkgs.mkShell rec {
name = "qois-infrastructure-shell";
buildInputs = let
buildInputs =
let
extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide ];
vscode-with-extensions =
pkgs.vscode-with-extensions.override { vscodeExtensions = extensions; };
in with pkgs; [ vscode-with-extensions nixfmt rnix-lsp ];
vscode-with-extensions = pkgs.vscode-with-extensions.override { vscodeExtensions = extensions; };
in
with pkgs;
[
vscode-with-extensions
nixfmt
rnix-lsp
];
LANG = "C.UTF-8";
LC_ALL = "C.UTF-8";
shellHook = ''