summaryrefslogtreecommitdiff
path: root/accounts/gkleen@vidhar.nix
blob: 8509c2f49c8c4d9d32e1724a61ee28c06686d1b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ flake, pkgs, userName, config, ... }: {
  config = {
    users.users.${userName} = {
      uid = 1000;
      openssh.authorizedKeys.keys = [
        "command=\"${pkgs.unison}/bin/unison -server\",no-port-forwarding,no-X11-forwarding,no-pty,no-agent-forwarding,no-user-rc ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA4izEz5pEjJqFLeJewHCoqtskqA+olKZNEP1yZWK7Ui gkleen@sif"
      ];
    };

    home-manager.users.${userName} = {
      home.stateVersion = "20.09";

      programs.ssh.matchBlocks = {
        "git.ymir" =
          { hostname = "ymir.yggdrasil.li";
            user = "gitolite";
            identityFile = "~/.ssh/gkleen@sif.midgard.yggdrasil.pub";
          };
        "git.yggdrasil.li" =
          { user = "gitolite";
            identityFile = "~/.ssh/gkleen@sif.midgard.yggdrasil.pub";
          };
        "ymir" =
          { hostname = "ymir.yggdrasil.li";
            identityFile = "~/.ssh/gkleen@sif.midgard.yggdrasil.pub";
          };
        "yggdrasil.borgbase" =
          { hostname = "nx69hpl8.repo.borgbase.com";
            user = "nx69hpl8";
            identityFile = "~/.ssh/borgbase";
          };
      };
      home.file = {
        ".config/user-tmpfiles.d/gnupg.conf".text = ''
          d /run/user/${toString config.users.users.${userName}.uid}/gnupg 0700 ${userName} ${config.users.users.${userName}.group} -
        '';
      };
    };
  };
}