Skip to content

Commit 814bbef

Browse files
bcachefs-unlock: Also handle mount paths
Co-authored-by: Will Fancher <[email protected]>
1 parent ca0c35d commit 814bbef

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

nixos/modules/tasks/filesystems/bcachefs.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,15 @@ let
9797
deviceUnit = mkDeviceUnit device;
9898
extractProperty =
9999
prop: options: (map (lib.removePrefix "${prop}=") (builtins.filter (lib.hasPrefix prop) options));
100-
normalizeUnits = unit: if lib.hasPrefix "/" unit then mkDeviceUnit unit else unit;
100+
mkMountUnit = path: "${utils.escapeSystemdPath path}.mount";
101+
normalizeUnits =
102+
unit:
103+
if lib.hasPrefix "/dev/" unit then
104+
mkDeviceUnit unit
105+
else if lib.hasPrefix "/" unit then
106+
mkMountUnit unit
107+
else
108+
unit;
101109
requiredUnits = map normalizeUnits (extractProperty "x-systemd.requires" fs.options);
102110
wantedUnits = map normalizeUnits (extractProperty "x-systemd.wants" fs.options);
103111
in

0 commit comments

Comments
 (0)