all repos — nixfiles @ ba08cd95da1d9198b898678f5d1159f825baaf14

System and user configuration, managed by nix and home-manager

system/roles/server.nix (view raw)

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
41
42
43
44
45
46
47
48
49
{
  config,
  pkgs,
  lib,
  ...
}:
{
  imports = [
    ../settings/configuration/nix-linux.nix
    ../settings/configuration/auto-upgrade.nix
    ../settings/configuration/date-time.nix
    ../settings/configuration/locale.nix

    ../settings/services/tailscale.nix
    ../settings/services/caddy.nix
    ../settings/services/ssh.nix

    ./base.nix
  ];

  services.tailscale = {
    useRoutingFeatures = "both";
    extraSetFlags = [
      "--advertise-exit-node"
    ];
  };

  services.sshguard = {
    enable = true;
  };

  services.journald.extraConfig = ''
    MaxRetentionSec=1 month
  '';

  systemd.services.update-home-manager = {
    startAt = "weekly";
    path = with pkgs; [
      openssh
      nix
      config.programs.git.package
    ];
    serviceConfig = rec {
      Type = "oneshot";
      User = "alin";
      ExecStart = "${lib.getExe pkgs.home-manager} switch --flake git+https://git.alin.ovh/nixfiles?submodules=1#${User}@%H";
    };
  };
}