From 63adb41f1a060c21a68143eb9e86c2790ef66f36 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 8 Aug 2024 10:45:09 +0200 Subject: ... --- hosts/sif/default.nix | 31 +++++++++++++++++++++++++++- hosts/sif/hw.nix | 57 ++++----------------------------------------------- 2 files changed, 34 insertions(+), 54 deletions(-) (limited to 'hosts/sif') diff --git a/hosts/sif/default.nix b/hosts/sif/default.nix index 3525015d..5ed4e05e 100644 --- a/hosts/sif/default.nix +++ b/hosts/sif/default.nix @@ -16,6 +16,7 @@ in { tmpfs-root bcachefs initrd-all-crypto-modules default-locale openssh rebuild-machines networkmanager flakeInputs.nixos-hardware.nixosModules.lenovo-thinkpad-p1 + flakeInputs.impermanence.nixosModules.impermanence ]; config = { @@ -555,7 +556,10 @@ in { # sound.enable = true; nix = { - settings.auto-optimise-store = true; + settings = { + auto-optimise-store = true; + max-jobs = 4; + }; daemonCPUSchedPolicy = "idle"; daemonIOSchedClass = "idle"; @@ -569,6 +573,11 @@ in { speedFactor = 4; }; }; + systemd.services."nix-daemon" = { + serviceConfig = { + CPUQuota = "400%"; + }; + }; environment.etc."X11/xorg.conf.d/50-wacom.conf".source = lib.mkForce ./wacom.conf; @@ -661,6 +670,26 @@ in { in [ gtk-portal ]; }; + environment.persistence."/.bcachefs" = { + hideMounts = true; + directories = [ + "/nix" + "/root" + "/var/log" + "/var/lib/sops-nix" + "/var/lib/nixos" + "/var/lib/systemd" + "/home" + "/var/lib/chrony" + "/var/lib/fprint" + "/var/lib/bluetooth" + "/etc/NetworkManager/system-connections" + ]; + files = [ + "/etc/localtime" + ]; + }; + system.stateVersion = "24.11"; }; } diff --git a/hosts/sif/hw.nix b/hosts/sif/hw.nix index 077d25a6..fc20ef7c 100644 --- a/hosts/sif/hw.nix +++ b/hosts/sif/hw.nix @@ -12,59 +12,11 @@ fsType = "bcachefs"; neededForBoot = true; }; - "/nix" = - { device = "/.bcachefs/nix"; - fsType = "none"; - options = [ "bind" ]; # "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; - }; - "/root" = - { device = "/.bcachefs/root"; - fsType = "none"; - options = [ "bind" ]; # "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; - }; - "/var/log" = - { device = "/.bcachefs/var/log"; - fsType = "none"; - options = [ "bind" ]; # "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; - }; - "/var/lib/sops-nix" = - { device = "/.bcachefs/var/lib/sops-nix"; - fsType = "none"; - options = [ "bind" ]; # "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; - neededForBoot = true; - }; - "/var/lib/nixos" = - { device = "/.bcachefs/var/lib/nixos"; - fsType = "none"; - options = [ "bind" ]; # "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; - }; - "/var/lib/chrony" = - { device = "/.bcachefs/var/lib/chrony"; - fsType = "none"; - options = [ "bind" ]; # "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; - }; - "/var/lib/fprint" = - { device = "/.bcachefs/var/lib/fprint"; - fsType = "none"; - options = [ "bind" ]; # "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; - }; - "/var/lib/systemd" = - { device = "/.bcachefs/var/lib/systemd"; - fsType = "none"; - options = [ "bind" ]; # "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; - neededForBoot = true; - }; - "/home" = - { device = "/.bcachefs/home"; - fsType = "none"; - options = [ "bind" ]; # "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; - }; - "/etc/NetworkManager/system-connections" = - { device = "/.bcachefs/etc/NetworkManager/system-connections"; - fsType = "none"; - options = [ "bind" ]; # "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; - }; + "/var/lib/sops-nix".neededForBoot = true; + "/var/lib/systemd".neededForBoot = true; }; + system.etc.overlay.enable = false; + systemd.sysusers.enable = false; # boot.initrd.supportedFilesystems.bcachefs = true; # boot.initrd.systemd.units."dev-sif-nvm0:-dev-sif-nvm1.device".enable = false; @@ -91,7 +43,6 @@ # }; # }; - nix.settings.max-jobs = 12; # High-DPI console console.font = "${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz"; -- cgit v1.2.3