mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
Merge pull request #152372 from symphorien/systemd-validate-after
nixos/systemd: validate the values of systemd.services.<name>.after
This commit is contained in:
commit
d6f45aa6c3
2 changed files with 15 additions and 12 deletions
|
@ -11,6 +11,9 @@ in rec {
|
|||
|
||||
mkPathSafeName = lib.replaceChars ["@" ":" "\\" "[" "]"] ["-" "-" "-" "" ""];
|
||||
|
||||
# a type for options that take a unit name
|
||||
unitNameType = types.strMatching "[a-zA-Z0-9@%:_.\\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)";
|
||||
|
||||
makeUnit = name: unit:
|
||||
if unit.enable then
|
||||
pkgs.runCommand "unit-${mkPathSafeName name}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue