fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Naïm Favierssh: don't install a client by default (#4016)2d963854

master
1.5 KiB62 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5{
6  config = {
7    programs.ssh = {
8      enable = true;
9      matchBlocks = {
10        abc = {
11          identityFile = null;
12          proxyJump = "jump-host";
13        };
14
15        ordered = hm.dag.entryAfter [ "xyz" ] { port = 1; };
16
17        xyz = {
18          identityFile = "file";
19          serverAliveInterval = 60;
20          serverAliveCountMax = 10;
21          localForwards = [{
22            bind.port = 8080;
23            host.address = "10.0.0.1";
24            host.port = 80;
25          }];
26          remoteForwards = [
27            {
28              bind.port = 8081;
29              host.address = "10.0.0.2";
30              host.port = 80;
31            }
32            {
33              bind.address = "/run/user/1000/gnupg/S.gpg-agent.extra";
34              host.address = "/run/user/1000/gnupg/S.gpg-agent";
35            }
36          ];
37          dynamicForwards = [{ port = 2839; }];
38          setEnv = {
39            FOO = "foo12";
40            BAR = "_bar_ 42";
41          };
42        };
43
44        "* !github.com" = {
45          identityFile = [ "file1" "file2" ];
46          port = 516;
47        };
48      };
49    };
50
51    home.file.assertions.text = builtins.toJSON
52      (map (a: a.message) (filter (a: !a.assertion) config.assertions));
53
54    nmt.script = ''
55      assertFileExists home-files/.ssh/config
56      assertFileContent \
57        home-files/.ssh/config \
58        ${./match-blocks-attrs-expected.conf}
59      assertFileContent home-files/assertions ${./no-assertions.json}
60    '';
61  };
62}