about summary refs log tree commit diff
path: root/hosts/profiles/nas.nix
blob: 5ec18d0f3cc996acb831e34847a4b41fa8db0a09 (plain) (blame)
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
{ config, pkgs, lib, ... }: {
  users.groups.nas.gid = 5000;
  users.users.nas = {
    uid = 5000;
    group = "nas";
    isSystemUser = true;
  };

  my.services = {
    samba = {
      enable = true;
      publicShares = [ "/data/fast/music" "/data/fast/videos" ];
    };
    navidrome = {
      enable = true;
      musicFolder = "/data/fast/music";
    };
    unifi = { enable = true; };
    prometheus = { enable = true; };
    grafana = { enable = true; };
    gitea = {
      enable = true;
      stateDir = "/var/lib/gitea";
    };
    rclone = { enable = true; };
    traefik = { enable = true; };
    transmission = { enable = true; };
    metrics-exporter = { enable = true; };
  };

  services.restic.backups = {
    media = {
      paths = [ "/data/fast/music" "/data/fast/photos" "/data/fast/videos" ];
      repository = "/data/slow/backups/systems";
      passwordFile = config.age.secrets.restic-repo-systems.path;
      timerConfig = { OnCalendar = "00:55"; };
      initialize = true;
      extraBackupArgs = [ "--tag media" ];
      pruneOpts = [ "--keep-daily 7" "--keep-weekly 4" "--keep-monthly 12" ];
    };
  };
}