diff options
| author | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-24 03:42:34 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-24 03:42:34 +0530 |
| commit | 44b8624d201e70c8418ada5db3c46e9ba130ea30 (patch) | |
| tree | ab960997bf8831d294dd84838523b358b7012ac5 /modules/security/ssh | |
| parent | 30f8fea050f3242f0e6a2072779e706b5c8ceaf1 (diff) | |
| download | home-manager-config-44b8624d201e70c8418ada5db3c46e9ba130ea30.tar.gz home-manager-config-44b8624d201e70c8418ada5db3c46e9ba130ea30.zip | |
refactor(naming): use kebab-case option names and consistent gopass secret naming
Diffstat (limited to 'modules/security/ssh')
| -rw-r--r-- | modules/security/ssh/default.nix | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/security/ssh/default.nix b/modules/security/ssh/default.nix index e18b933..ed93e27 100644 --- a/modules/security/ssh/default.nix +++ b/modules/security/ssh/default.nix @@ -6,13 +6,15 @@ ... }: let + cfg = config.security.ssh; + gpgSshKeyLoad = pkgs.writeShellApplication { name = "gpg-ssh-key-load"; runtimeInputs = [ config.terminal.bash.package config.security.gopass.package config.security.gpg.package - config.security.ssh.package + cfg.package pkgs.coreutils ]; text = @@ -22,7 +24,7 @@ let "@@GNUPGHOME@@" ] [ - config.security.ssh.sshKeyGopassPath + cfg.ssh-key-gopass-secret config.home.sessionVariables.GNUPGHOME ] (builtins.readFile ./gpg-ssh-key-load.sh); @@ -38,7 +40,7 @@ in description = "The ssh package to use."; }; - sshKeyGopassPath = lib.mkOption { + ssh-key-gopass-secret = lib.mkOption { type = lib.types.nullOr lib.types.str; default = null; description = '' @@ -50,8 +52,8 @@ in }; config = lib.mkMerge [ - (lib.mkIf config.security.ssh.enable { - home.packages = [ config.security.ssh.package ]; + (lib.mkIf cfg.enable { + home.packages = [ cfg.package ]; assertions = [ { @@ -64,7 +66,7 @@ in ]; }) - (lib.mkIf (config.security.ssh.enable && config.security.ssh.sshKeyGopassPath != null) { + (lib.mkIf (cfg.enable && cfg.ssh-key-gopass-secret != null) { home.activation.gpgSshKeyLoad = lib.hm.dag.entryAfter [ "writeBoundary" ] '' run ${lib.getExe gpgSshKeyLoad} || true ''; |
