about summary refs log tree commit diff
path: root/nixos/modules/tasks/filesystems
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-10-21 18:01:53 +0000
committerGitHub <noreply@github.com>2023-10-21 18:01:53 +0000
commitf4afba201428530fdb713fda18d055bd99daf333 (patch)
treea760cddec5bad37433f29f2c1c2c75b6fba8d05d /nixos/modules/tasks/filesystems
parentb52540749224057bb31cfb20168fe71474cf2116 (diff)
parenta01279cf2329f710bb84f3aa64d32ea87a8c4124 (diff)
downloadnixlib-f4afba201428530fdb713fda18d055bd99daf333.tar
nixlib-f4afba201428530fdb713fda18d055bd99daf333.tar.gz
nixlib-f4afba201428530fdb713fda18d055bd99daf333.tar.bz2
nixlib-f4afba201428530fdb713fda18d055bd99daf333.tar.lz
nixlib-f4afba201428530fdb713fda18d055bd99daf333.tar.xz
nixlib-f4afba201428530fdb713fda18d055bd99daf333.tar.zst
nixlib-f4afba201428530fdb713fda18d055bd99daf333.zip
Merge staging-next into staging
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;