mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
nixos: Fix up systemd shutdown ramfs
This commit is contained in:
parent
e325f7aeaa
commit
69d8047516
7 changed files with 76 additions and 43 deletions
|
@ -1,4 +1,4 @@
|
|||
{ lib, systemdUtils }:
|
||||
{ lib, systemdUtils, pkgs }:
|
||||
|
||||
with systemdUtils.lib;
|
||||
with systemdUtils.unitOptions;
|
||||
|
@ -34,4 +34,36 @@ rec {
|
|||
|
||||
automounts = with types; listOf (submodule [ stage2AutomountOptions unitConfig automountConfig ]);
|
||||
initrdAutomounts = with types; attrsOf (submodule [ stage1AutomountOptions unitConfig automountConfig ]);
|
||||
|
||||
initrdContents = types.attrsOf (types.submodule ({ config, options, name, ... }: {
|
||||
options = {
|
||||
enable = mkEnableOption "copying of this file and symlinking it" // { default = true; };
|
||||
|
||||
target = mkOption {
|
||||
type = types.path;
|
||||
description = ''
|
||||
Path of the symlink.
|
||||
'';
|
||||
default = name;
|
||||
};
|
||||
|
||||
text = mkOption {
|
||||
default = null;
|
||||
type = types.nullOr types.lines;
|
||||
description = "Text of the file.";
|
||||
};
|
||||
|
||||
source = mkOption {
|
||||
type = types.path;
|
||||
description = "Path of the source file.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
source = mkIf (config.text != null) (
|
||||
let name' = "initrd-" + baseNameOf name;
|
||||
in mkDerivedConfig options.text (pkgs.writeText name')
|
||||
);
|
||||
};
|
||||
}));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue