From 48f8d3c11d9117f10e6ca5b76a08b91cef5c861b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 1 Aug 2024 10:31:11 +0200 Subject: ... --- hosts/sif/hw.nix | 76 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 37 deletions(-) (limited to 'hosts/sif/hw.nix') diff --git a/hosts/sif/hw.nix b/hosts/sif/hw.nix index a2991def..d01582e0 100644 --- a/hosts/sif/hw.nix +++ b/hosts/sif/hw.nix @@ -7,87 +7,89 @@ fsType = "vfat"; options = [ "fmask=0033" "dmask=0022" ]; }; - # "/.bcachefs" = - # { device = "/dev/mapper/sif-nvm0:/dev/mapper/sif-nvm1"; - # fsType = "bcachefs"; - # neededForBoot = true; - # }; + "/.bcachefs" = + { device = "/dev/mapper/sif-nvm0:/dev/mapper/sif-nvm1"; + fsType = "bcachefs"; + neededForBoot = true; + }; "/nix" = { device = "/.bcachefs/nix"; fsType = "none"; - options = [ "bind" "x-systemd.after=bcachefs.service" "x-systemd.requires=bcachefs.service" ]; + 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" ]; + 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" ]; + 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" ]; + 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" ]; + 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" ]; + options = [ "bind" ]; # "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; }; "/var/lib/fprint" = { device = "/.bcachefs/var/lib/fprint"; fsType = "none"; - options = [ "bind" ]; + 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" ]; + 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" ]; + 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" ]; + options = [ "bind" ]; # "x-systemd.after=\\x2ebcachefs.mount" "x-systemd.requires=\\x2ebcachefs.mount" ]; }; }; - 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"; } - ]; + # 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; + # }; + # }; + # systemd.services."bcachefs" = { + # serviceConfig = { + # Type = "oneshot"; + # ExecStart = "${pkgs.coreutils}/bin/true"; + # }; + # }; nix.settings.max-jobs = 12; # High-DPI console -- cgit v1.2.3