mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
nixos: Support fileSystems.<name>.depends with fstab-generator
This commit is contained in:
parent
c32bd049ad
commit
b7c5fd93f1
@ -1,4 +1,4 @@
|
||||
{ config, lib, pkgs, utils, ... }:
|
||||
{ config, lib, pkgs, utils, ... }@moduleArgs:
|
||||
|
||||
with lib;
|
||||
with utils;
|
||||
@ -136,10 +136,21 @@ let
|
||||
|
||||
};
|
||||
|
||||
config.options = mkMerge [
|
||||
config.options = let
|
||||
inInitrd = utils.fsNeededForBoot config;
|
||||
in mkMerge [
|
||||
(mkIf config.autoResize [ "x-systemd.growfs" ])
|
||||
(mkIf config.autoFormat [ "x-systemd.makefs" ])
|
||||
(mkIf (utils.fsNeededForBoot config) [ "x-initrd.mount" ])
|
||||
(mkIf
|
||||
# With scripted stage 1, depends is implemented by sorting 'config.system.build.fileSystems'
|
||||
(lib.length config.depends > 0 && (inInitrd -> moduleArgs.config.boot.initrd.systemd.enable))
|
||||
(
|
||||
map (
|
||||
x: "x-systemd.requires-mounts-for=${optionalString inInitrd "/sysroot"}${x}"
|
||||
) config.depends
|
||||
)
|
||||
)
|
||||
];
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user