mirror of
https://github.com/nix-community/home-manager
synced 2024-12-27 12:19:48 +01:00
32 lines
606 B
Nix
32 lines
606 B
Nix
|
{ config, lib, pkgs, ... }:
|
||
|
|
||
|
with lib;
|
||
|
|
||
|
{
|
||
|
config = {
|
||
|
systemd.user.slices.app-test = {
|
||
|
Unit = { Description = "Slice for a test app"; };
|
||
|
|
||
|
Slice = {
|
||
|
MemoryHigh = "30%";
|
||
|
MemoryMax = "40%";
|
||
|
};
|
||
|
};
|
||
|
|
||
|
nmt.script = ''
|
||
|
sliceFile=home-files/.config/systemd/user/app-test.slice
|
||
|
assertFileExists $sliceFile
|
||
|
assertFileContent $sliceFile ${
|
||
|
builtins.toFile "app-test-expected.conf" ''
|
||
|
[Slice]
|
||
|
MemoryHigh=30%
|
||
|
MemoryMax=40%
|
||
|
|
||
|
[Unit]
|
||
|
Description=Slice for a test app
|
||
|
''
|
||
|
}
|
||
|
'';
|
||
|
};
|
||
|
}
|