Merge pull request #152372 from symphorien/systemd-validate-after

nixos/systemd: validate the values of systemd.services.<name>.after
This commit is contained in:
Guillaume Girol
2022-01-31 20:57:13 +00:00
committed by GitHub
2 changed files with 15 additions and 12 deletions

View File

@@ -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}"