1 { lib, systemdUtils, pkgs }:
4 with systemdUtils.unitOptions;
9 attrsOf (submodule ({ name, config, ... }: {
10 options = concreteUnitOptions;
11 config = { unit = mkDefault (systemdUtils.lib.makeUnit name config); };
14 services = with types; attrsOf (submodule [ stage2ServiceOptions unitConfig stage2ServiceConfig ]);
15 initrdServices = with types; attrsOf (submodule [ stage1ServiceOptions unitConfig stage1ServiceConfig ]);
17 targets = with types; attrsOf (submodule [ stage2CommonUnitOptions unitConfig ]);
18 initrdTargets = with types; attrsOf (submodule [ stage1CommonUnitOptions unitConfig ]);
20 sockets = with types; attrsOf (submodule [ stage2SocketOptions unitConfig ]);
21 initrdSockets = with types; attrsOf (submodule [ stage1SocketOptions unitConfig ]);
23 timers = with types; attrsOf (submodule [ stage2TimerOptions unitConfig ]);
24 initrdTimers = with types; attrsOf (submodule [ stage1TimerOptions unitConfig ]);
26 paths = with types; attrsOf (submodule [ stage2PathOptions unitConfig ]);
27 initrdPaths = with types; attrsOf (submodule [ stage1PathOptions unitConfig ]);
29 slices = with types; attrsOf (submodule [ stage2SliceOptions unitConfig ]);
30 initrdSlices = with types; attrsOf (submodule [ stage1SliceOptions unitConfig ]);
32 mounts = with types; listOf (submodule [ stage2MountOptions unitConfig mountConfig ]);
33 initrdMounts = with types; listOf (submodule [ stage1MountOptions unitConfig mountConfig ]);
35 automounts = with types; listOf (submodule [ stage2AutomountOptions unitConfig automountConfig ]);
36 initrdAutomounts = with types; attrsOf (submodule [ stage1AutomountOptions unitConfig automountConfig ]);
38 initrdContents = types.attrsOf (types.submodule ({ config, options, name, ... }: {
40 enable = mkEnableOption (lib.mdDoc "copying of this file and symlinking it") // { default = true; };
44 description = lib.mdDoc ''
52 type = types.nullOr types.lines;
53 description = lib.mdDoc "Text of the file.";
58 description = lib.mdDoc "Path of the source file.";
63 source = mkIf (config.text != null) (
64 let name' = "initrd-" + baseNameOf name;
65 in mkDerivedConfig options.text (pkgs.writeText name')