aboutsummaryrefslogtreecommitdiffstats
path: root/modules/security
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-09-02 15:46:30 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-09-02 15:46:30 +0530
commit9f214ab3276ff432f54a07d7d79f87c1a8be0991 (patch)
tree184076a67e5de8ba46a88a1959aedcdabca628e1 /modules/security
parent2aa898cfe9877a9b9e4694b4b20002555ed6e46f (diff)
parentb2e34bad67147e8fde874c7c014b65c81fa2f361 (diff)
downloadhome-manager-config-9f214ab3276ff432f54a07d7d79f87c1a8be0991.tar.gz
home-manager-config-9f214ab3276ff432f54a07d7d79f87c1a8be0991.zip
Merge branch 'gopass-git-sync'
Diffstat (limited to 'modules/security')
-rw-r--r--modules/security/gopass/default.nix36
-rw-r--r--modules/security/gopass/gopass-ssh-load.sh3
2 files changed, 33 insertions, 6 deletions
diff --git a/modules/security/gopass/default.nix b/modules/security/gopass/default.nix
index fa5e486..4d223e9 100644
--- a/modules/security/gopass/default.nix
+++ b/modules/security/gopass/default.nix
@@ -16,11 +16,17 @@ let
openssh
bash
];
- text = ''
- export GNUPGHOME="${config.home.sessionVariables.GNUPGHOME}"
- export GOPASS_SSH_KEYS="${lib.concatStringsSep " " gopassKeys}"
- ${builtins.readFile ./gopass-ssh-load.sh}
- '';
+ text =
+ builtins.replaceStrings
+ [
+ "@@GOPASS_SSH_KEYS@@"
+ "@@GNUPGHOME@@"
+ ]
+ [
+ (lib.concatStringsSep " " gopassKeys)
+ config.home.sessionVariables.GNUPGHOME
+ ]
+ (builtins.readFile ./gopass-ssh-load.sh);
};
in
{
@@ -53,6 +59,26 @@ in
};
};
+ # use a different username and email to show these commits are auto
+ # generated by gopass
+ programs.git.includes = lib.mkIf config.development.git.enable [
+ {
+ condition = "gitdir:${config.programs.password-store.settings.PASSWORD_STORE_DIR}/";
+ contents = {
+ user = {
+ name = "Gopass of ${config.home.username}";
+ email = "${config.home.username}@gopass.localhost";
+ };
+ commit = {
+ gpgSign = false;
+ };
+ tag = {
+ gpgSign = false;
+ };
+ };
+ }
+ ];
+
home.sessionVariables = {
PASSWORD_STORE_DIR = config.programs.password-store.settings.PASSWORD_STORE_DIR;
};
diff --git a/modules/security/gopass/gopass-ssh-load.sh b/modules/security/gopass/gopass-ssh-load.sh
index c6b9a29..e974713 100644
--- a/modules/security/gopass/gopass-ssh-load.sh
+++ b/modules/security/gopass/gopass-ssh-load.sh
@@ -4,7 +4,8 @@ set -o nounset
set -o pipefail
# Load SSH keys from gopass password store
-export GNUPGHOME="${GNUPGHOME:-$HOME/.local/share/gnupg}"
+export GNUPGHOME="@@GNUPGHOME@@"
+export GOPASS_SSH_KEYS="@@GOPASS_SSH_KEYS@@"
SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
export SSH_AUTH_SOCK