diff options
| author | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-24 04:02:19 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-24 04:02:19 +0530 |
| commit | 5ea8c30b7b82d4c1e7164541892066b1f24f7d22 (patch) | |
| tree | ad9b994cc5415f63bae1f2342f520756d43c67ce /modules/security/ssh | |
| parent | ad96214c9ab94bce925000a6059e3c68e2ff6a22 (diff) | |
| parent | 748669e19daa3afc8f0cfe10eedc19ae9766ed2c (diff) | |
| download | home-manager-config-5ea8c30b7b82d4c1e7164541892066b1f24f7d22.tar.gz home-manager-config-5ea8c30b7b82d4c1e7164541892066b1f24f7d22.zip | |
Merge branch 'massive-refactoring'
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 ''; |
