about summary refs log tree commit diff
path: root/nixos/modules/tasks/filesystems
diff options
context:
space:
mode:
authorRyan Lahfa <masterancpp@gmail.com>2023-10-21 18:04:13 +0100
committerGitHub <noreply@github.com>2023-10-21 18:04:13 +0100
commite6ade691a5d39144118357b39bc11505db715d89 (patch)
tree70422b14c254e5ee9addb3e531f1ee8cdd7c59f4 /nixos/modules/tasks/filesystems
parent68c8ffed7f2e200dda40baa11bd161f3142077ef (diff)
parent524714f7eaa37f599c978bc7cb6085934ca2c6b5 (diff)
downloadnixlib-e6ade691a5d39144118357b39bc11505db715d89.tar
nixlib-e6ade691a5d39144118357b39bc11505db715d89.tar.gz
nixlib-e6ade691a5d39144118357b39bc11505db715d89.tar.bz2
nixlib-e6ade691a5d39144118357b39bc11505db715d89.tar.lz
nixlib-e6ade691a5d39144118357b39bc11505db715d89.tar.xz
nixlib-e6ade691a5d39144118357b39bc11505db715d89.tar.zst
nixlib-e6ade691a5d39144118357b39bc11505db715d89.zip
Merge pull request #259347 from ElvishJerricco/systemd-stage-1-zfs-sysusr-dependency
systemd 254: ZFS /usr fix with systemd-stage-1
Diffstat (limited to 'nixos/modules/tasks/filesystems')
-rw-r--r--nixos/modules/tasks/filesystems/zfs.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix
index 7e7811fd3339..082634ec9d01 100644
--- a/nixos/modules/tasks/filesystems/zfs.nix
+++ b/nixos/modules/tasks/filesystems/zfs.nix
@@ -90,12 +90,17 @@ let
 
   getPoolMounts = prefix: pool:
     let
+      poolFSes = getPoolFilesystems pool;
+
       # Remove the "/" suffix because even though most mountpoints
       # won't have it, the "/" mountpoint will, and we can't have the
       # trailing slash in "/sysroot/" in stage 1.
       mountPoint = fs: escapeSystemdPath (prefix + (lib.removeSuffix "/" fs.mountPoint));
+
+      hasUsr = lib.any (fs: fs.mountPoint == "/usr") poolFSes;
     in
-      map (x: "${mountPoint x}.mount") (getPoolFilesystems pool);
+      map (x: "${mountPoint x}.mount") poolFSes
+      ++ lib.optional hasUsr "sysusr-usr.mount";
 
   getKeyLocations = pool: if isBool cfgZfs.requestEncryptionCredentials then {
     hasKeys = cfgZfs.requestEncryptionCredentials;