From 6783226919f6c401714b669ac7e0d93bac6858ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Mon, 29 Jan 2024 23:02:05 +0100 Subject: [PATCH] pie/paperless: align img2pdf versions --- hosts/pie/paperless.nix | 3 +- hosts/stroopwafel/configuration.nix | 18 ++++++---- hosts/stroopwafel/hardware-configuration.nix | 35 ++++++++++---------- hosts/stroopwafel/networking.nix | 1 - hosts/stroopwafel/persistence.nix | 21 +++++++----- 5 files changed, 42 insertions(+), 36 deletions(-) diff --git a/hosts/pie/paperless.nix b/hosts/pie/paperless.nix index 9ffd48c..2798dd1 100644 --- a/hosts/pie/paperless.nix +++ b/hosts/pie/paperless.nix @@ -36,7 +36,7 @@ with lib; let done pdf="${consumptionDir}/$NAME.pdf" - ${python39Packages.img2pdf}/bin/img2pdf --output $pdf ''${files[@]} + ${python3Packages.img2pdf}/bin/img2pdf --output $pdf ''${files[@]} echo "PDF written to $pdf" ''; @@ -63,7 +63,6 @@ in { users.users."${psCfg.user.name}".packages = with pkgs; [ scan2paperless sane-backends - python310Packages.img2pdf ]; home-manager.users."${psCfg.user.name}" = { diff --git a/hosts/stroopwafel/configuration.nix b/hosts/stroopwafel/configuration.nix index 1e312cd..76a5d2c 100644 --- a/hosts/stroopwafel/configuration.nix +++ b/hosts/stroopwafel/configuration.nix @@ -8,21 +8,25 @@ with lib; let psCfg = config.pub-solar; xdg = config.home-manager.users."${psCfg.user.name}".xdg; in { + boot.plymouth.enable = true; + # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - boot.plymouth.enable = true; + + boot.initrd.preLVMCommands = "udevadm trigger --settle"; + boot.swraid.enable = true; + boot.swraid.mdadmConf = '' +DEVICE /dev/nvme0n1p2 /dev/nvme1n1p2 +ARRAY /dev/md/nixos:root metadata=1.2 name=nixos:root UUID=67d1aa81:1b348887:c17a75e8:f2edf2bd + ''; pub-solar.core.disk-encryption-active = false; + pub-solar.core.hibernation.enable = true; + pub-solar.core.hibernation.resumeDevice = "/dev/mapper/vg0-swap"; - pub-solar.core.hibernation.enable = false; - pub-solar.core.hibernation.resumeDevice = "/dev/dm-0"; - pub-solar.core.hibernation.resumeOffset = 15296512; pub-solar.terminal-life.full = true; - # https://nixos.wiki/wiki/ZFS#declarative_mounting_of_ZFS_datasets - systemd.services.zfs-mount.enable = false; - home-manager.users."${psCfg.user.name}" = { xdg.configFile = { "sway/config.d/10-screens.conf".source = ./.config/sway/config.d/screens.conf; diff --git a/hosts/stroopwafel/hardware-configuration.nix b/hosts/stroopwafel/hardware-configuration.nix index d08c66e..2059399 100644 --- a/hosts/stroopwafel/hardware-configuration.nix +++ b/hosts/stroopwafel/hardware-configuration.nix @@ -8,47 +8,48 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; + boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-id/md-name-nixos:root"; + fileSystems."/" = - { device = "rpool/local/root"; - fsType = "zfs"; + { device = "none"; + fsType = "tmpfs"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/13B8-529E"; + { device = "/dev/disk/by-uuid/EC82-67F4"; fsType = "vfat"; }; - fileSystems."/nix" = - { device = "rpool/local/nix"; - fsType = "zfs"; + fileSystems."/home" = + { device = "/dev/disk/by-uuid/0cc568f0-402d-4535-980a-ed3a1dc697b9"; + fsType = "ext4"; }; - fileSystems."/home" = - { device = "rpool/safe/home"; - fsType = "zfs"; + fileSystems."/nix" = + { device = "/dev/disk/by-uuid/e203d629-4d34-4147-bee6-919f0bfa25de"; + fsType = "ext4"; }; fileSystems."/persist" = - { device = "rpool/safe/persist"; - fsType = "zfs"; + { device = "/dev/disk/by-uuid/a0855aaa-76bf-445e-b0d1-ab1552e5496f"; + fsType = "ext4"; }; swapDevices = - [ { device = "/dev/zvol/rpool/swap"; } + [ { device = "/dev/disk/by-uuid/761507ab-479d-414b-ac3e-2149564ca470"; } ]; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's # still possible to use this option, but it's recommended to use it in conjunction # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; + # networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp6s0f4u1u4.useDHCP = lib.mkDefault true; networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; diff --git a/hosts/stroopwafel/networking.nix b/hosts/stroopwafel/networking.nix index 8638429..062ee0c 100644 --- a/hosts/stroopwafel/networking.nix +++ b/hosts/stroopwafel/networking.nix @@ -5,7 +5,6 @@ lib, ... }: { - networking.hostId = "acab9998"; networking.hostName = "stroopwafel"; networking.networkmanager.wifi.backend = "wpa_supplicant"; diff --git a/hosts/stroopwafel/persistence.nix b/hosts/stroopwafel/persistence.nix index 11ec76f..6204878 100644 --- a/hosts/stroopwafel/persistence.nix +++ b/hosts/stroopwafel/persistence.nix @@ -1,14 +1,21 @@ { lib, ... }: { + systemd.tmpfiles.rules = [ + "L /var/lib/bluetooth - - - - /persist/var/lib/bluetooth" + "d /persist/var/lib/bluetooth 0500 root root" + + "L /var/lib/docker - - - - /persist/var/lib/docker" + "d /persist/var/lib/docker 0510 root root" + + "d /persist/etc/NetworkManager/system-connections 0500 root root" + + "d /persist/etc/ssh 0400 root root" + ]; + environment.etc."NetworkManager/system-connections" = { source = "/persist/etc/NetworkManager/system-connections/"; }; - systemd.tmpfiles.rules = [ - "L /var/lib/bluetooth - - - - /persist/var/lib/bluetooth" - "L /var/lib/docker - - - - /persist/var/lib/docker" - ]; - services.openssh = { enable = true; hostKeys = [ @@ -23,8 +30,4 @@ } ]; }; - - boot.initrd.postDeviceCommands = lib.mkAfter '' - zfs rollback -r rpool/local/root@blank - ''; }