mirror of
https://github.com/nix-community/impermanence
synced 2024-11-13 23:27:15 +00:00
nixos: Fix create-needed-for-boot-dirs dependencies for zfs
This commit is contained in:
parent
8514fff0f0
commit
a8fb3f78a9
1 changed files with 11 additions and 4 deletions
15
nixos.nix
15
nixos.nix
|
@ -719,8 +719,14 @@ in
|
|||
matchFileSystems = fs: attrValues (filterAttrs (_: v: v.mountPoint or null == fs) all);
|
||||
in
|
||||
concatMap matchFileSystems persistentStoragePaths;
|
||||
devices =
|
||||
map (d: "${(escapeSystemdPath d)}.device") (catAttrs "device" fileSystems);
|
||||
deviceUnits = unique
|
||||
(map
|
||||
(fs:
|
||||
if fs.fsType == "zfs" then
|
||||
"zfs-import.target"
|
||||
else
|
||||
"${(escapeSystemdPath fs.device)}.device")
|
||||
fileSystems);
|
||||
createNeededForBootDirs = ''
|
||||
${concatMapStrings mkMount fileSystems}
|
||||
${concatMapStrings mkDir neededForBootDirs}
|
||||
|
@ -731,10 +737,11 @@ in
|
|||
systemd.services = mkIf config.boot.initrd.systemd.enable {
|
||||
create-needed-for-boot-dirs = {
|
||||
wantedBy = [ "initrd-root-device.target" ];
|
||||
wants = devices;
|
||||
after = devices;
|
||||
requires = deviceUnits;
|
||||
after = deviceUnits;
|
||||
before = [ "sysroot.mount" ];
|
||||
serviceConfig.Type = "oneshot";
|
||||
unitConfig.DefaultDependencies = false;
|
||||
script = createNeededForBootDirs;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue