ssh: add includes option (#2453)

This commit is contained in:
Tobias Happ 2021-11-16 19:51:10 +01:00 committed by GitHub
parent 42915b78af
commit 5559ef0023
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 38 additions and 13 deletions

View file

@ -1,7 +1,5 @@
Host *
ForwardAgent no
Compression no

View file

@ -1,5 +1,6 @@
{
ssh-defaults = ./default-config.nix;
ssh-includes = ./includes.nix;
ssh-match-blocks = ./match-blocks-attrs.nix;
ssh-forwards-dynamic-valid-bind-no-asserts =

View file

@ -1,8 +1,5 @@
Host dynamicBindAddressWithPort
DynamicForward [127.0.0.1]:3000
Host dynamicBindPathNoPort
DynamicForward /run/user/1000/gnupg/S.gpg-agent.extra

View file

@ -0,0 +1,15 @@
{ config, lib, pkgs, ... }:
{
config = {
programs.ssh = {
enable = true;
includes = [ "config.d/*" "other/dir" ];
};
nmt.script = ''
assertFileExists home-files/.ssh/config
assertFileContains home-files/.ssh/config "Include config.d/* other/dir"
'';
};
}

View file

@ -1,13 +1,9 @@
Host * !github.com
Port 516
IdentityFile file1
IdentityFile file2
Host abc
ProxyJump jump-host
Host xyz
ServerAliveInterval 60
ServerAliveCountMax 10
@ -16,7 +12,6 @@ Host xyz
RemoteForward [localhost]:8081 [10.0.0.2]:80
RemoteForward /run/user/1000/gnupg/S.gpg-agent.extra /run/user/1000/gnupg/S.gpg-agent
DynamicForward [localhost]:2839
Host ordered
Port 1