File tree Expand file tree Collapse file tree 8 files changed +44
-13
lines changed
Expand file tree Collapse file tree 8 files changed +44
-13
lines changed Original file line number Diff line number Diff line change 2222 "/var/lib/bluetooth" # blueman connections
2323 "/var/lib/nixos" # uid and gid mappings
2424 "/var/log" # logs
25- "/var/lib/rancher/k3s" # k3s cluster
2625 "/var/lib/docker" # docker rootful
2726 ] ;
2827 files = [
Original file line number Diff line number Diff line change 88 ../services/matrix.nix
99 ../services/miniflux.nix
1010 ../services/prometheus.nix
11+ ../services/restic-rest.nix
1112 inputs . wunschkonzert-install . include
1213 ] ;
1314}
Original file line number Diff line number Diff line change 7575 }
7676 ] ;
7777 }
78+ {
79+ job_name = "restic-server" ;
80+ static_configs = [
81+ {
82+ targets = [
83+ "localhost:8000"
84+ ] ;
85+ labels = {
86+ host = "${ hostname } " ;
87+ } ;
88+ }
89+ ] ;
90+ }
7891 ] ;
7992 } ;
8093
Original file line number Diff line number Diff line change 1+ { ...} : {
2+ services . restic . server = {
3+ enable = true ;
4+ prometheus = true ;
5+ htpasswd-file = "/var/lib/restic/htpasswd" ;
6+ extraFlags = [
7+ "--no-auth"
8+ ] ;
9+ } ;
10+
11+ # no firewall rule means only accessible on trusted interfaces, i.e. lo and tailscale
12+
13+ environment . persistence . "/nix/persist" = {
14+ directories = [
15+ "/var/lib/restic"
16+ ] ;
17+ } ;
18+ }
Original file line number Diff line number Diff line change 33 pkgs ,
44 ...
55} : {
6- environment . systemPackages = with pkgs ; [
7- restic
8- ] ;
6+ age . secrets . restic_password = {
7+ file = ../../secrets/restic_password.age ;
8+ owner = "danieln" ;
9+ } ;
910
1011 services . restic . backups . daily = {
1112 initialize = true ;
12- rcloneConfigFile = config . age . secrets . restic_rclone_config . path ;
1313 passwordFile = config . age . secrets . restic_password . path ;
1414 paths = [ "/nix/persist" ] ;
1515 exclude = [
1616 "var/log"
17+ "home/danieln/go" # golang cache
1718 "home/danieln/scratch" # random repos
1819 "home/danieln/downloads" # random crap
1920 "home/danieln/.local/share/Steam" # steam and its games
2324 "home/danieln/.config/Slack" # slack syncs itself
2425 "home/danieln/.mozilla" # nothing that firefox sync won't cover
2526 "home/danieln/.config/TeamSpeak" # nothing of value
27+ "home/danieln/code/*/.cache" # direnv caches etc
28+ # huge repo that I don't care about
29+ "home/danieln/code/qmk"
30+ "home/danieln/code/qmk_firmware"
31+ "home/danieln/code/Garmin"
2632 ] ;
27- repository = "rclone:b2:danieln-backups/simmons " ;
33+ repository = "rest:http://hyperion.squirrel-emperor.ts.net:8000/ ${ config . networking . hostName } " ;
2834 timerConfig = {
2935 OnCalendar = "daily" ;
3036 Persistent = true ;
3541 "--keep-yearly 10"
3642 ] ;
3743 } ;
38-
39- systemd . services . restic-backups-daily = {
40- wants = [ "network.target" ] ;
41- after = [ "network.target" ] ;
42- } ;
4344}
Original file line number Diff line number Diff line change 11{ ...} : {
22 imports = [
3- # ./backup.nix
3+ ./backup.nix
44 ./boot.nix
55 ./steam.nix
66 ] ;
Original file line number Diff line number Diff line change 55 all = [ simmons hyperion lusus ] ;
66in {
77 "password.age" . publicKeys = all ;
8- "restic_rclone_config.age" . publicKeys = all ;
98 "restic_password.age" . publicKeys = all ;
109 "tailscale.age" . publicKeys = all ;
1110 "grafana.age" . publicKeys = all ;
You can’t perform that action at this time.
0 commit comments