Skip to content

Commit

Permalink
Merge pull request #221 from nix-community/labels
Browse files Browse the repository at this point in the history
nixos: Fix create-needed-for-boot-dirs label-adressed dependencies
  • Loading branch information
talyz authored Sep 29, 2024
2 parents fff0d95 + 82f2b47 commit d0b38e5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nixos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -695,10 +695,11 @@ in
let
neededForBootFs = catAttrs "mountPoint" (filter fsNeededForBoot (attrValues config.fileSystems));
neededForBootDirs = filter (dir: elem dir.dirPath neededForBootFs) directories;
getDevice = fs: if fs.device != null then fs.device else "/dev/disk/by-label/${fs.label}";
mkMount = fs:
let
mountPoint = concatPaths [ "/persist-tmp-mnt" fs.mountPoint ];
device = if fs.device != null then fs.device else "/dev/disk/by-label/${fs.label}";
device = getDevice fs;
options = filter (o: (builtins.match "(x-.*\.mount)" o) == null) fs.options;
optionsFlag = optionalString (options != [ ]) ("-o " + escapeShellArg (concatStringsSep "," options));
in
Expand All @@ -725,7 +726,7 @@ in
if fs.fsType == "zfs" then
"zfs-import.target"
else
"${(escapeSystemdPath fs.device)}.device")
"${(escapeSystemdPath (getDevice fs))}.device")
fileSystems);
createNeededForBootDirs = ''
${concatMapStrings mkMount fileSystems}
Expand Down

0 comments on commit d0b38e5

Please sign in to comment.