User-domain agents are not rediscovered from the user LaunchAgents directory after reboot. Let built-in agents inherit the GUI default while keeping explicit user-domain configuration available.
28 lines
1 KiB
Nix
28 lines
1 KiB
Nix
{ lib, pkgs, ... }:
|
|
|
|
{
|
|
services.glance.enable = true;
|
|
|
|
nmt.script = lib.mkMerge [
|
|
''
|
|
configFile=home-files/.config/glance/glance.yml
|
|
assertFileContent $configFile ${./glance-default-config.yml}
|
|
''
|
|
(lib.mkIf pkgs.stdenv.hostPlatform.isLinux ''
|
|
serviceFile=home-files/.config/systemd/user/glance.service
|
|
serviceFile=$(normalizeStorePaths $serviceFile)
|
|
assertFileContent $serviceFile ${./glance.service}
|
|
'')
|
|
(lib.mkIf pkgs.stdenv.hostPlatform.isDarwin ''
|
|
serviceFile=LaunchAgents/org.nix-community.home.glance.plist
|
|
serviceFile=$(normalizeStorePaths $serviceFile)
|
|
assertFileExists "$serviceFile"
|
|
assertFileContent "$serviceFile" ${./glance.plist}
|
|
|
|
domainFile=LaunchAgentDomains/org.nix-community.home.glance.domain
|
|
assertFileContent "$domainFile" ${builtins.toFile "expected-domain" "gui\n"}
|
|
assertFileContains activate 'domain="gui/$(id -u)"'
|
|
assertFileContains activate 'launchctl kickstart -k "$domain/org.nix-community.home.glance"'
|
|
'')
|
|
];
|
|
}
|