diff --git a/nixos/modules/tasks/filesystems/bcachefs.nix b/nixos/modules/tasks/filesystems/bcachefs.nix index 1390b87f1711..36e1fba3e711 100644 --- a/nixos/modules/tasks/filesystems/bcachefs.nix +++ b/nixos/modules/tasks/filesystems/bcachefs.nix @@ -97,7 +97,15 @@ let deviceUnit = mkDeviceUnit device; extractProperty = prop: options: (map (lib.removePrefix "${prop}=") (builtins.filter (lib.hasPrefix prop) options)); - normalizeUnits = unit: if lib.hasPrefix "/" unit then mkDeviceUnit unit else unit; + mkMountUnit = path: "${utils.escapeSystemdPath path}.mount"; + normalizeUnits = + unit: + if lib.hasPrefix "/dev/" unit then + mkDeviceUnit unit + else if lib.hasPrefix "/" unit then + mkMountUnit unit + else + unit; requiredUnits = map normalizeUnits (extractProperty "x-systemd.requires" fs.options); wantedUnits = map normalizeUnits (extractProperty "x-systemd.wants" fs.options); in