From ede2763756955f1cae7056cbc5f663ffd45033fe Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sun, 7 Jan 2024 21:39:40 +0800 Subject: [PATCH] fix: agenix on darwin - check if secrets already exists --- secrets/darwin.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/secrets/darwin.nix b/secrets/darwin.nix index eee480b0..d43435b7 100644 --- a/secrets/darwin.nix +++ b/secrets/darwin.nix @@ -77,6 +77,10 @@ # # activationScripts are executed every time you run `nixos-rebuild` / `darwin-rebuild` or boot your system system.activationScripts.postActivation.text = '' - sudo chown ${username} /etc/agenix/* + ${pkgs.nushell}/bin/nu -c ' + if (ls /etc/agenix/ | length) > 0 { + sudo chown ${username} /etc/agenix/* + } + ' ''; }