1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-09 04:39:44 +01:00
home-manager/tests/modules/systemd/user-config.nix
Olli Helenius 6a8444467c
systemd: add settings option (#4276)
The `systemd.user.extraConfig` provides a way to generate a
`systemd-user.conf(5)` file for the user.

This is the home-manager equivalent of NixOS’s option of the same
name, with the difference that NixOS’s option generates a `user.conf`
file that is shared between all users.
2023-11-07 07:55:17 -07:00

25 lines
545 B
Nix

{ pkgs, ... }:
{
systemd.user.settings.Manager = {
LogLevel = "debug";
DefaultCPUAccounting = true;
DefaultEnvironment = {
TEST = "abc";
PATH = "/bin:/sbin:/some where";
};
};
nmt.script = ''
userConf=home-files/.config/systemd/user.conf
assertFileExists $userConf
assertFileContent $userConf ${
pkgs.writeText "expected" ''
[Manager]
DefaultCPUAccounting=true
DefaultEnvironment=PATH='/bin:/sbin:/some where' TEST='abc'
LogLevel=debug
''
}
'';
}