Skip to content

Commit

Permalink
fix: ssh port expression only nixos configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Oct 11, 2023
1 parent 01b42ec commit 94ed190
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion modules/home/tools/ssh/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ let
RemoteForward /run/user/${remote-user-id}/gnupg/S.gpg-agent /run/user/${user-id}/gnupg/S.gpg-agent.extra
RemoteForward /run/user/${remote-user-id}/gnupg/S.gpg-agent.ssh /run/user/${user-id}/gnupg/S.gpg-agent.ssh
'';
port-expr = if builtins.hasAttr name inputs.self.nixosConfigurations then "Port ${builtins.toString cfg.port}" else "";
in
''
Host ${name}
Hostname ${name}.local
User ${remote-user-name}
ForwardAgent yes
Port ${builtins.toString cfg.port}
${port-expr}
${forward-gpg}
''
)
Expand Down
3 changes: 2 additions & 1 deletion modules/nixos/services/openssh/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ let
RemoteForward /run/user/${remote-user-id}/gnupg/S.gpg-agent /run/user/${user-id}/gnupg/S.gpg-agent.extra
RemoteForward /run/user/${remote-user-id}/gnupg/S.gpg-agent.ssh /run/user/${user-id}/gnupg/S.gpg-agent.ssh
'';
port-expr = if builtins.hasAttr name inputs.self.nixosConfigurations then "Port ${builtins.toString cfg.port}" else "";
in
''
Host ${name}
Hostname ${name}.local
User ${remote-user-name}
ForwardAgent yes
Port ${builtins.toString cfg.port}
${port-expr}
${forward-gpg}
''
)
Expand Down

0 comments on commit 94ed190

Please sign in to comment.