1
Fork 0

Attempt to use nixos filesystems to mount usb

This commit is contained in:
Matei Adriel 2024-01-18 01:47:25 +01:00
parent 638a81e61a
commit d9b438536f
No known key found for this signature in database
2 changed files with 21 additions and 12 deletions

View file

@ -8,5 +8,8 @@
# Mark a bunch of paths as needed for boot # Mark a bunch of paths as needed for boot
fileSystems = lib.attrsets.genAttrs fileSystems = lib.attrsets.genAttrs
[ "/" "/nix" "/persist/data" "/persist/state" "/persist/local/cache" "/boot" ] [ "/" "/nix" "/persist/data" "/persist/state" "/persist/local/cache" "/boot" ]
(_: { neededForBoot = true; }); (_: {
neededForBoot = true;
depends = [ "/hermes" ];
});
} }

View file

@ -8,18 +8,24 @@ in
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
boot.kernelParams = [ "nohibernate" ]; boot.kernelParams = [ "nohibernate" ];
# {{{ Mount usb for zfs secrets fileSystems."/hermes" = {
boot.initrd.systemd.mounts = [{ neededForBoot = true;
where = "/hermes"; device = "/dev/disk/by-uuid/7FE7-CA68";
what = "/dev/sdb"; fsType = "exfat";
};
# The usb contains sensitive data that should only be readable to root # # {{{ Mount usb for zfs secrets
# mountConfig.DirectoryMode = "0750"; # boot.initrd.systemd.mounts = [{
# where = "/hermes";
wantedBy = [ "zfs-import.target" ]; # what = "/dev/sdb";
before = [ "zfs-import.target" ]; #
}]; # # The usb contains sensitive data that should only be readable to root
# }}} # # mountConfig.DirectoryMode = "0750";
#
# wantedBy = [ "zfs-import.target" ];
# before = [ "zfs-import.target" ];
# }];
# # }}}
boot.initrd.systemd.services = { boot.initrd.systemd.services = {
# # {{{ Rollback # # {{{ Rollback