diff options
| author | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-10 19:44:00 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-10 19:44:00 +0530 |
| commit | e483a7d255fc27aea1d1d1a7963ea4b93ad0c47e (patch) | |
| tree | d061db5411de504d2d5570a4958a1352516a1b3b /modules/security/gopass/default.nix | |
| parent | f1787032594f7ca1a6521f5665a48bb70605d222 (diff) | |
| parent | bdee6f183cd38ff7539618336c5448a10f432aae (diff) | |
| download | home-manager-config-e483a7d255fc27aea1d1d1a7963ea4b93ad0c47e.tar.gz home-manager-config-e483a7d255fc27aea1d1d1a7963ea4b93ad0c47e.zip | |
Merge branch 'fixing-ssh-agent'
Diffstat (limited to 'modules/security/gopass/default.nix')
| -rw-r--r-- | modules/security/gopass/default.nix | 50 |
1 files changed, 13 insertions, 37 deletions
diff --git a/modules/security/gopass/default.nix b/modules/security/gopass/default.nix index 4cf9182..123b33f 100644 --- a/modules/security/gopass/default.nix +++ b/modules/security/gopass/default.nix @@ -5,30 +5,6 @@ pkgs, ... }: -let - gopassKeys = config.security.ssh.gopassKeys; - - gopassSshLoadScript = pkgs.writeShellApplication { - name = "gopass-ssh-load"; - runtimeInputs = [ - config.security.gopass.package - config.security.gpg.package - config.security.ssh.package - config.terminal.bash.package - ]; - text = - builtins.replaceStrings - [ - "@@GOPASS_SSH_KEYS@@" - "@@GNUPGHOME@@" - ] - [ - (lib.concatStringsSep " " gopassKeys) - config.home.sessionVariables.GNUPGHOME - ] - (builtins.readFile ./gopass-ssh-load.sh); - }; -in { options.security.gopass = { enable = lib.mkEnableOption "Enables gopass."; @@ -38,15 +14,6 @@ in default = config.programs.password-store.package; description = "The gopass package to use."; }; - ssh-agent = { - enable = lib.mkEnableOption "gopass-backed SSH keys for git"; - package = lib.mkOption { - type = lib.types.package; - readOnly = true; - default = gopassSshLoadScript; - description = "The gopass-ssh-load script package."; - }; - }; sync = { enable = lib.mkEnableOption "Enables git-backed syncing of the gopass data directory."; remote = lib.mkOption { @@ -67,6 +34,9 @@ in }; }; }; + creation-templates = { + enable = lib.mkEnableOption "Enables gopass entry creation templates. New entry creation templates for gopass new or gopass create commands."; + }; }; config = lib.mkMerge [ @@ -116,6 +86,16 @@ in source = ../../../assets/icons/apps/gopass.svg; }; + home.activation.copyCreationTemplatesForGopass = + lib.mkIf config.security.gopass.creation-templates.enable + ( + lib.hm.dag.entryAfter [ "writeBoundary" ] '' + $DRY_RUN_CMD mkdir -p $VERBOSE_ARG "${config.programs.password-store.settings.PASSWORD_STORE_DIR}/.gopass/create" + $DRY_RUN_CMD rm -rf ${config.programs.password-store.settings.PASSWORD_STORE_DIR}/.gopass/create + $DRY_RUN_CMD cp -r $VERBOSE_ARG --no-preserve=mode ${./creation-templates} "${config.programs.password-store.settings.PASSWORD_STORE_DIR}/.gopass/create" + '' + ); + xdg.desktopEntries."gopass" = { name = "gopass"; exec = "${lib.getExe config.terminal.kitty.package} --class gopass -e ${lib.getExe config.security.gopass.package}"; @@ -127,10 +107,6 @@ in }; }) - (lib.mkIf config.security.gopass.ssh-agent.enable { - home.packages = [ config.security.gopass.ssh-agent.package ]; - }) - (lib.mkIf config.security.gopass.sync.enable { home.activation.gopassSyncInit = let |
