1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-01 08:49:44 +01:00
home-manager/tests/modules/systemd/slices.nix

28 lines
518 B
Nix
Raw Normal View History

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