grace/dots

dotfiles/nix configs

git clone https://git.gae.moe/grace/dots

Grace Yoderi gotta stop doing these massive changesb70d9f9

main
1.7 KiB65 linesraw
1{ pkgs, ... }:
2
3{
4  imports = [
5    ../modules/dns.nix
6    ../modules/nginx.nix
7    ../modules/ntfy.nix
8    ../modules/gitsrv.nix
9    ../modules/url.nix
10    ../modules/tailscale.nix
11    ../modules/users.nix
12    ../modules/nixos-base.nix
13  ];
14
15  systemd.services.backup-ext = {
16    description = "Mirror /mnt/ext to dijkstra";
17    wants = [ "network-online.target" ];
18    after = [ "network-online.target" ];
19    unitConfig.RequiresMountsFor = [ "/mnt/ext" ];
20    path = [ pkgs.openssh pkgs.rsync pkgs.util-linux ];
21    serviceConfig.Type = "oneshot";
22    script = ''
23      mountpoint -q /mnt/ext
24      ssh -o BatchMode=yes -o StrictHostKeyChecking=yes -i /root/.ssh/id_ed25519 grace@d.i.gae.moe \
25        'mountpoint -q /mnt/backup && sudo -n mkdir -p /mnt/backup/knuth'
26      rsync -aHAX --numeric-ids --delete-delay --stats \
27        -e 'ssh -o BatchMode=yes -o StrictHostKeyChecking=yes -i /root/.ssh/id_ed25519' \
28        --rsync-path='mountpoint -q /mnt/backup && sudo -n rsync' \
29        /mnt/ext/ grace@d.i.gae.moe:/mnt/backup/knuth/
30    '';
31  };
32  systemd.timers.backup-ext = {
33    wantedBy = [ "timers.target" ];
34    timerConfig = {
35      OnCalendar = "daily";
36      Persistent = true;
37    };
38  };
39
40  boot.loader.grub = {
41    enable = true;
42    device = "/dev/vda";
43  };
44  system.stateVersion = "25.11";
45  nix = {
46    distributedBuilds = true;
47
48    settings = {
49      max-jobs = 0;
50      builders-use-substitutes = true;
51    };
52
53    buildMachines = [
54      {
55        hostName = "d.i.gae.moe";
56        sshUser = "builder";
57        sshKey = "/root/.ssh/id_ed25519";
58        protocol = "ssh-ng";
59        system = "x86_64-linux";
60        maxJobs = 8;
61        speedFactor = 1;
62      }
63    ];
64  };
65}