mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 20:55:31 +03:00
nixos: systemd: Split unit types into separate module
This commit is contained in:
parent
397b8257a0
commit
52c98fc3e9
4 changed files with 46 additions and 36 deletions
29
nixos/lib/systemd-types.nix
Normal file
29
nixos/lib/systemd-types.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ lib, systemdUtils }:
|
||||
|
||||
with systemdUtils.lib;
|
||||
with systemdUtils.unitOptions;
|
||||
with lib;
|
||||
|
||||
rec {
|
||||
units = with types;
|
||||
attrsOf (submodule ({ name, config, ... }: {
|
||||
options = concreteUnitOptions;
|
||||
config = { unit = mkDefault (systemdUtils.lib.makeUnit name config); };
|
||||
}));
|
||||
|
||||
services = with types; attrsOf (submodule [ { options = serviceOptions; } unitConfig serviceConfig ]);
|
||||
|
||||
targets = with types; attrsOf (submodule [ { options = targetOptions; } unitConfig ]);
|
||||
|
||||
sockets = with types; attrsOf (submodule [ { options = socketOptions; } unitConfig ]);
|
||||
|
||||
timers = with types; attrsOf (submodule [ { options = timerOptions; } unitConfig ]);
|
||||
|
||||
paths = with types; attrsOf (submodule [ { options = pathOptions; } unitConfig ]);
|
||||
|
||||
slices = with types; attrsOf (submodule [ { options = sliceOptions; } unitConfig ]);
|
||||
|
||||
mounts = with types; listOf (submodule [ { options = mountOptions; } unitConfig mountConfig ]);
|
||||
|
||||
automounts = with types; listOf (submodule [ { options = automountOptions; } unitConfig automountConfig ]);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue