mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
nixos/systemd: Allow creation of unit directories
This patch allows creation of files like /etc/systemd/system/user-.slice.d/limits.conf with systemd.units."user-.slice.d/limits.conf" = { text = '' [Slice] CPUAccounting=yes CPUQuota=50% ''; }; which previously threw an error Also renames the systemd-unit-path test to sytsemd-misc, and extends it to test that `systemd.units` can handle directories. In this case we make sure that resource limits specified in user slices apply.
This commit is contained in:
parent
4d60081494
commit
c70a466d21
3 changed files with 23 additions and 6 deletions
|
@ -23,8 +23,9 @@ in rec {
|
|||
inherit (unit) text;
|
||||
}
|
||||
''
|
||||
mkdir -p $out
|
||||
echo -n "$text" > $out/${shellEscape name}
|
||||
name=${shellEscape name}
|
||||
mkdir -p "$out/$(dirname "$name")"
|
||||
echo -n "$text" > "$out/$name"
|
||||
''
|
||||
else
|
||||
pkgs.runCommand "unit-${mkPathSafeName name}-disabled"
|
||||
|
@ -32,8 +33,9 @@ in rec {
|
|||
allowSubstitutes = false;
|
||||
}
|
||||
''
|
||||
mkdir -p $out
|
||||
ln -s /dev/null $out/${shellEscape name}
|
||||
name=${shellEscape name}
|
||||
mkdir -p "$out/$(dirname "$name")"
|
||||
ln -s /dev/null "$out/$name"
|
||||
'';
|
||||
|
||||
boolValues = [true false "yes" "no"];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue