File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ pkgs ,
3+ self ,
4+ } :
5+ let
6+ opensshWrapped = self . wrappedModules . openssh . wrap {
7+ inherit pkgs ;
8+
9+ settings = ''
10+ Host foo
11+ User bar
12+ HostName 192.168.0.2
13+ ProxyJump baz
14+
15+ Host baz
16+ HostName 192.168.0.1
17+ '' ;
18+ } ;
19+
20+ in
21+ if builtins . elem pkgs . stdenv . hostPlatform . system self . wrappedModules . openssh . meta . platforms then
22+ pkgs . runCommand "ssh-test" { } ''
23+ "${ opensshWrapped } /bin/ssh" -G foo | grep -q 'HostName 192.168.0.2'
24+ touch $out
25+ ''
26+ else
27+ null
Original file line number Diff line number Diff line change 1+ {
2+ config ,
3+ wlib ,
4+ lib ,
5+ ...
6+ } :
7+ {
8+ imports = [ wlib . modules . default ] ;
9+
10+ options = {
11+ settings = lib . mkOption {
12+ type = lib . types . string ;
13+ default = "" ;
14+ description = ''
15+ OpenSSH client configuration settings.
16+ See `man 5 ssh_config`
17+ '' ;
18+ example = ''
19+ Host foo
20+ User bar
21+ HostName 192.168.0.2
22+ ProxyJump baz
23+
24+ Host baz
25+ HostName 192.168.0.1
26+ '' ;
27+ } ;
28+ } ;
29+
30+ config = {
31+ package = lib . mkDefault config . pkgs . openssh ;
32+ flags = {
33+ "-F" = builtins . toString ( config . pkgs . writeText "ssh-config" config . settings ) ;
34+ } ;
35+ meta = {
36+ inherit ( config . package ) platforms ;
37+ maintainers = [ wlib . maintainers . patwid ] ;
38+ } ;
39+ } ;
40+ }
You can’t perform that action at this time.
0 commit comments