From 122679ce1a17ebdf6eacbd12c0f50e140a295513 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 31 Jul 2024 08:06:18 +0200 Subject: ... --- hosts/sif/hw.nix | 50 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 14 deletions(-) (limited to 'hosts/sif/hw.nix') diff --git a/hosts/sif/hw.nix b/hosts/sif/hw.nix index f3b20580..a2991def 100644 --- a/hosts/sif/hw.nix +++ b/hosts/sif/hw.nix @@ -5,17 +5,17 @@ "/boot" = { label = "boot"; fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; - "/.bcachefs" = - { device = "/dev/mapper/sif-nvm0:/dev/mapper/sif-nvm1"; - fsType = "bcachefs"; - neededForBoot = true; + options = [ "fmask=0033" "dmask=0022" ]; }; + # "/.bcachefs" = + # { device = "/dev/mapper/sif-nvm0:/dev/mapper/sif-nvm1"; + # fsType = "bcachefs"; + # neededForBoot = true; + # }; "/nix" = { device = "/.bcachefs/nix"; fsType = "none"; - options = [ "bind" ]; + options = [ "bind" "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" ]; }; "/root" = { device = "/.bcachefs/root"; @@ -25,29 +25,33 @@ "/var/log" = { device = "/.bcachefs/var/log"; fsType = "none"; - options = [ "bind" ]; + options = [ "bind" "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" ]; }; "/var/lib/sops-nix" = { device = "/.bcachefs/var/lib/sops-nix"; fsType = "none"; - options = [ "bind" ]; + options = [ "bind" "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" ]; neededForBoot = true; }; "/var/lib/nixos" = { device = "/.bcachefs/var/lib/nixos"; fsType = "none"; - options = [ "bind" ]; - neededForBoot = true; + options = [ "bind" "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" ]; }; "/var/lib/chrony" = { device = "/.bcachefs/var/lib/chrony"; fsType = "none"; options = [ "bind" ]; }; + "/var/lib/fprint" = + { device = "/.bcachefs/var/lib/fprint"; + fsType = "none"; + options = [ "bind" ]; + }; "/var/lib/systemd" = { device = "/.bcachefs/var/lib/systemd"; fsType = "none"; - options = [ "bind" ]; + options = [ "bind" "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" ]; neededForBoot = true; }; "/home" = @@ -61,7 +65,25 @@ options = [ "bind" ]; }; }; - boot.initrd.systemd.services."unlock-bcachefs-${utils.escapeSystemdPath "/.bcachefs"}".enable = false; + + boot.initrd.supportedFilesystems.bcachefs = true; + boot.initrd.systemd.units."dev-sif-nvm0:-dev-sif-nvm1.device".enable = false; + systemd.units."dev-sif-nvm0:-dev-sif-nvm1.device".enable = false; + boot.initrd.systemd.services."bcachefs" = { + before = [ "initrd-fs.target" ]; + after = [ "local-fs-pre.target" "dev-sif-nvm0.device" "dev-sif-nvm1.device" ]; + requires = [ "dev-sif-nvm0.device" "dev-sif-nvm1.device" ]; + wantedBy = [ "initrd-fs.target" ]; + unitConfig = { + DefaultDependencies = false; + StopPropagatedFrom = [ "dev-sif-nvm0.device" "dev-sif-nvm1.device" ]; + }; + serviceConfig = { + Type = "oneshot"; + ExecStart = "/bin/mount -o X-mount.mkdir -t bcachefs /dev/sif/nvm0:/dev/sif/nvm1 /sysroot/.bcachefs"; + RemainAfterExit = true; + }; + }; swapDevices = [ { label = "swap"; } @@ -72,6 +94,6 @@ console.font = "${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz"; hardware.cpu.intel.updateMicrocode = true; - + hardware.enableRedistributableFirmware = true; } -- cgit v1.2.3