summary refs log tree commit diff stats
path: root/user/settings
diff options
context:
space:
mode:
authorAlan Pearce2023-06-16 17:00:05 +0200
committerAlan Pearce2023-06-16 17:03:04 +0200
commitaec14387c6651a4a067ef2ece4105210feeb4bc9 (patch)
tree9310d30d92481b76b28682f9ea4e038fc1a5e062 /user/settings
parentbaef3925a7a9efecd1c666c0cbb8b3a9b7e19d34 (diff)
downloadnixfiles-aec14387c6651a4a067ef2ece4105210feeb4bc9.tar.lz
nixfiles-aec14387c6651a4a067ef2ece4105210feeb4bc9.tar.zst
nixfiles-aec14387c6651a4a067ef2ece4105210feeb4bc9.zip
Use Strongbox as an SSH agent instead of Secretive
Diffstat (limited to 'user/settings')
-rw-r--r--user/settings/darwin.nix14
1 files changed, 13 insertions, 1 deletions
diff --git a/user/settings/darwin.nix b/user/settings/darwin.nix
index 99c71326..1ffac101 100644
--- a/user/settings/darwin.nix
+++ b/user/settings/darwin.nix
@@ -1,5 +1,6 @@
 { config
 , pkgs
+, lib
 , ...
 }: {
   nixpkgs.overlays = [
@@ -141,7 +142,18 @@
     path+=($HOME/Library/Python/3.9/bin)
   '';
   programs.ssh.extraConfig = ''
-    IdentityAgent /Users/alan/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh
+    IdentityAgent ~/.strongbox/agent.sock
+  '';
+  home.activation.linkStrongboxSSHAgentSocket = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
+    if [[ ! -d ~/.strongbox ]]
+    then
+      $DRY_RUN_CMD mkdir ~/.strongbox
+    fi
+    if [[ ! -S ~/.strongbox/agent.sock ]]
+    then
+      $DRY_RUN_CMD ln -s $VERBOSE_ARG \
+        ~/Library/Group\ Containers/group.strongbox.mac.mcguill/agent.sock ~/.strongbox/agent.sock
+    fi
   '';
 
   # Use GPG from  GPGTools