mirror of
https://github.com/Mic92/sops-nix.git
synced 2026-02-22 21:05:44 +08:00
fix(darwin): guard launchctl bootstrap on plist existence
During home-manager activation, the bootstrap call can fail if the LaunchAgent plist hasn't been written yet. Check that the plist file exists before attempting to load it.
This commit is contained in:
parent
2d0cf89b44
commit
b6f5735434
1 changed files with 4 additions and 1 deletions
|
|
@ -411,10 +411,13 @@ in
|
|||
darwin =
|
||||
let
|
||||
domain-target = "gui/$(id -u ${config.home.username})";
|
||||
plist = "${config.home.homeDirectory}/Library/LaunchAgents/org.nix-community.home.sops-nix.plist";
|
||||
in
|
||||
''
|
||||
/bin/launchctl bootout ${domain-target}/org.nix-community.home.sops-nix && true
|
||||
/bin/launchctl bootstrap ${domain-target} ${config.home.homeDirectory}/Library/LaunchAgents/org.nix-community.home.sops-nix.plist
|
||||
if [[ -f ${plist} ]]; then
|
||||
/bin/launchctl bootstrap ${domain-target} ${plist}
|
||||
fi
|
||||
'';
|
||||
|
||||
linux =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue