zaphyra's git: nixfiles

zaphyra's nixfiles

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 
{
  config,
  lib,
  pkgs,
  ...
}:

{

  options.zpha.programs.ssh.enable = lib.mkEnableOption "ssh";

  config = lib.mkIf config.zpha.programs.ssh.enable {
    preservation.preserveAt."/persist".users.zaphyra.directories = [
      {
        directory = ".ssh";
        mode = "0700";
      }
    ];

    users.users.zaphyra.maid = {
      packages = [ pkgs.openssh ];

      file.home.".ssh/config".text = ''
        Host *
          Compression yes
          ControlMaster yes
          ControlPersist 2m
          ServerAliveInterval 30

        Host zaphyra-git
          User git
          Hostname git.zaphyra.eu
      '';
    };
  };

}