2023-05-12 22:08:12 +00:00
|
|
|
{ ... }:
|
2022-10-07 04:49:39 +00:00
|
|
|
|
|
|
|
{
|
2023-05-12 22:08:12 +00:00
|
|
|
systemd.user.slices.app-test = {
|
|
|
|
Unit = { Description = "Slice for a test app"; };
|
2022-10-07 04:49:39 +00:00
|
|
|
|
2023-05-12 22:08:12 +00:00
|
|
|
Slice = {
|
|
|
|
MemoryHigh = "30%";
|
|
|
|
MemoryMax = "40%";
|
2022-10-07 04:49:39 +00:00
|
|
|
};
|
2023-05-12 22:08:12 +00:00
|
|
|
};
|
2022-10-07 04:49:39 +00:00
|
|
|
|
2023-05-12 22:08:12 +00:00
|
|
|
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%
|
2022-10-07 04:49:39 +00:00
|
|
|
|
2023-05-12 22:08:12 +00:00
|
|
|
[Unit]
|
|
|
|
Description=Slice for a test app
|
|
|
|
''
|
|
|
|
}
|
|
|
|
'';
|
2022-10-07 04:49:39 +00:00
|
|
|
}
|