* systemd: add `packages` option The `systemd.user.packages` option is the Home Manager equivalent of NixOS’s `systemd.packages` option and provides a way to specify packages providing systemd user units. This option is similar to `dbus.packages`. * systemd: only create the parent directory if there are packages to symlink
20 lines
517 B
Nix
20 lines
517 B
Nix
{ pkgs, config, ... }:
|
|
let
|
|
package = config.lib.test.mkStubPackage {
|
|
buildScript = ''
|
|
mkdir -p $out/share/systemd/user
|
|
> $out/share/systemd/user/dummy.service cat <<EOF
|
|
[Service]
|
|
ExecStart=$out/bin/nonexistent
|
|
EOF
|
|
'';
|
|
};
|
|
in
|
|
{
|
|
systemd.user.packages = [ package ];
|
|
nmt.script = ''
|
|
serviceFile=home-files/.local/share/systemd/user/dummy.service
|
|
assertFileExists "$serviceFile"
|
|
assertFileContent "$serviceFile" ${package}/share/systemd/user/dummy.service
|
|
'';
|
|
}
|