From d9b438536f4e6dca1c282e8c43725a9db53acf61 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 18 Jan 2024 01:47:25 +0100 Subject: [PATCH] Attempt to use nixos filesystems to mount usb --- hosts/nixos/lapetus/filesystems/default.nix | 5 +++- hosts/nixos/lapetus/filesystems/zfs.nix | 28 +++++++++++++-------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/hosts/nixos/lapetus/filesystems/default.nix b/hosts/nixos/lapetus/filesystems/default.nix index e7f434a..46e5520 100644 --- a/hosts/nixos/lapetus/filesystems/default.nix +++ b/hosts/nixos/lapetus/filesystems/default.nix @@ -8,5 +8,8 @@ # Mark a bunch of paths as needed for boot fileSystems = lib.attrsets.genAttrs [ "/" "/nix" "/persist/data" "/persist/state" "/persist/local/cache" "/boot" ] - (_: { neededForBoot = true; }); + (_: { + neededForBoot = true; + depends = [ "/hermes" ]; + }); } diff --git a/hosts/nixos/lapetus/filesystems/zfs.nix b/hosts/nixos/lapetus/filesystems/zfs.nix index c3c15bc..88db873 100644 --- a/hosts/nixos/lapetus/filesystems/zfs.nix +++ b/hosts/nixos/lapetus/filesystems/zfs.nix @@ -8,18 +8,24 @@ in boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; boot.kernelParams = [ "nohibernate" ]; - # {{{ Mount usb for zfs secrets - boot.initrd.systemd.mounts = [{ - where = "/hermes"; - what = "/dev/sdb"; + fileSystems."/hermes" = { + neededForBoot = true; + device = "/dev/disk/by-uuid/7FE7-CA68"; + fsType = "exfat"; + }; - # The usb contains sensitive data that should only be readable to root - # mountConfig.DirectoryMode = "0750"; - - wantedBy = [ "zfs-import.target" ]; - before = [ "zfs-import.target" ]; - }]; - # }}} + # # {{{ Mount usb for zfs secrets + # boot.initrd.systemd.mounts = [{ + # where = "/hermes"; + # what = "/dev/sdb"; + # + # # 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 = { # # {{{ Rollback