diff --git a/flake.lock b/flake.lock index 6f6e07f..94a7bcf 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1753140376, - "narHash": "sha256-7lrVrE0jSvZHrxEzvnfHFE/Wkk9DDqb+mYCodI5uuB8=", + "lastModified": 1752718651, + "narHash": "sha256-PkaR0qmyP9q/MDN3uYa+RLeBA0PjvEQiM0rTDDBXkL8=", "owner": "nix-community", "repo": "disko", - "rev": "545aba02960caa78a31bd9a8709a0ad4b6320a5c", + "rev": "d5ad4485e6f2edcc06751df65c5e16572877db88", "type": "github" }, "original": { @@ -41,11 +41,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1753121425, - "narHash": "sha256-TVcTNvOeWWk1DXljFxVRp+E0tzG1LhrVjOGGoMHuXio=", + "lastModified": 1751413152, + "narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "644e0fc48951a860279da645ba77fe4a6e814c5e", + "rev": "77826244401ea9de6e3bac47c2db46005e1f30b5", "type": "github" }, "original": { @@ -222,11 +222,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1753122741, - "narHash": "sha256-nFxE8lk9JvGelxClCmwuJYftbHqwnc01dRN4DVLUroM=", + "lastModified": 1752666637, + "narHash": "sha256-P8J72psdc/rWliIvp8jUpoQ6qRDlVzgSDDlgkaXQ0Fw=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "cc66fddc6cb04ab479a1bb062f4d4da27c936a22", + "rev": "d1bfa8f6ccfb5c383e1eba609c1eb67ca24ed153", "type": "github" }, "original": { @@ -237,11 +237,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1753345091, - "narHash": "sha256-CdX2Rtvp5I8HGu9swBmYuq+ILwRxpXdJwlpg8jvN4tU=", + "lastModified": 1752620740, + "narHash": "sha256-f3pO+9lg66mV7IMmmIqG4PL3223TYMlnlw+pnpelbss=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3ff0e34b1383648053bba8ed03f201d3466f90c9", + "rev": "32a4e87942101f1c9f9865e04dc3ddb175f5f32e", "type": "github" }, "original": { @@ -294,11 +294,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1753429684, - "narHash": "sha256-9h7+4/53cSfQ/uA3pSvCaBepmZaz/dLlLVJnbQ+SJjk=", + "lastModified": 1752687322, + "narHash": "sha256-RKwfXA4OZROjBTQAl9WOZQFm7L8Bo93FQwSJpAiSRvo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7fd36ee82c0275fb545775cc5e4d30542899511d", + "rev": "6e987485eb2c77e5dcc5af4e3c70843711ef9251", "type": "github" }, "original": { diff --git a/modules/services/backup/default.nix b/modules/services/backup/default.nix index f13612f..8b78db5 100644 --- a/modules/services/backup/default.nix +++ b/modules/services/backup/default.nix @@ -126,8 +126,7 @@ in "/data/todo" "/home/*/tmp" "/home/*/todo" - ] - ++ cfg.exclude; + ] ++ cfg.exclude; extraCreateArgs = [ "--exclude-caches" @@ -146,30 +145,31 @@ in inherit (cfg) doInit; compression = "auto,zstd"; - postHook = '' - if (( $exitStatus > 1 )); then - '' - + lib.optionalString cfg.OnFailureNotification '' - # iterate over all logged in users - for user in $(users); do - sway_pid=$(${pkgs.procps}/bin/pgrep -x "sway" -u "$user") - if [ -n "$sway_pid" ]; then - # set environment variables - export $(cat /proc/$sway_pid/environ | grep -z '^DBUS_SESSION_BUS_ADDRESS=' | tr -d '\0') - export DISPLAY=:0 - # send notification via dbus: https://wiki.archlinux.org/title/Desktop_notifications#Bash - ${lib.getExe pkgs.sudo} --preserve-env=DBUS_SESSION_BUS_ADDRESS,DISPLAY -u $user ${lib.getExe pkgs.libnotify} -u critical "BorgBackup Failed!" "Run journalctl -u borgbackup-job* for more details." - echo "sent notification" + postHook = + '' + if (( $exitStatus > 1 )); then + '' + + lib.optionalString cfg.OnFailureNotification '' + # iterate over all logged in users + for user in $(users); do + sway_pid=$(${pkgs.procps}/bin/pgrep -x "sway" -u "$user") + if [ -n "$sway_pid" ]; then + # set environment variables + export $(cat /proc/$sway_pid/environ | grep -z '^DBUS_SESSION_BUS_ADDRESS=' | tr -d '\0') + export DISPLAY=:0 + # send notification via dbus: https://wiki.archlinux.org/title/Desktop_notifications#Bash + ${lib.getExe pkgs.sudo} --preserve-env=DBUS_SESSION_BUS_ADDRESS,DISPLAY -u $user ${lib.getExe pkgs.libnotify} -u critical "BorgBackup Failed!" "Run journalctl -u borgbackup-job* for more details." + echo "sent notification" + fi + done + '' + + lib.optionalString (cfg.OnFailureMail != null) '' + journalctl -u borgbackup-job-hetzner.service --since "5 days ago" | ${pkgs.mailutils}/bin/mail -r "Administrator" -s "Backup Error" server@buehler.rocks + echo "sent mail" + '' + + '' fi - done - '' - + lib.optionalString (cfg.OnFailureMail != null) '' - journalctl -u borgbackup-job-hetzner.service --since "5 days ago" | ${pkgs.mailutils}/bin/mail -r "Administrator" -s "Backup Error" server@buehler.rocks - echo "sent mail" - '' - + '' - fi - ''; + ''; # for mail sending readWritePaths = lib.optional (cfg.OnFailureMail != null) "/var/lib/postfix/queue/maildrop/"; diff --git a/modules/services/blocky/default.nix b/modules/services/blocky/default.nix index f5e336b..8c23f84 100644 --- a/modules/services/blocky/default.nix +++ b/modules/services/blocky/default.nix @@ -49,8 +49,7 @@ in ]; }; prometheus.enable = config.services.prometheus.enable; - } - // cfg.settings; + } // cfg.settings; }; prometheus.scrapeConfigs = [ diff --git a/modules/services/hedgedoc/default.nix b/modules/services/hedgedoc/default.nix index 9510604..11ad8b6 100644 --- a/modules/services/hedgedoc/default.nix +++ b/modules/services/hedgedoc/default.nix @@ -41,8 +41,7 @@ in dialect = "sqlite"; storage = "/var/lib/hedgedoc/hedgedoc.sqlite"; }; - } - // cfg.settings; + } // cfg.settings; }; prometheus = { diff --git a/modules/services/home-automation/default.nix b/modules/services/home-automation/default.nix index 9164cff..e39ec2c 100644 --- a/modules/services/home-automation/default.nix +++ b/modules/services/home-automation/default.nix @@ -108,8 +108,7 @@ in "esphome" "shelly" "prometheus" - ] - ++ cfg.extraComponents; + ] ++ cfg.extraComponents; }; prometheus.scrapeConfigs = [ diff --git a/modules/services/paperless/default.nix b/modules/services/paperless/default.nix index e7e231c..208ad6b 100644 --- a/modules/services/paperless/default.nix +++ b/modules/services/paperless/default.nix @@ -33,8 +33,7 @@ in inherit (cfg) mediaDir passwordFile; settings = { PAPERLESS_OCR_LANGUAGE = "deu+eng"; - } - // cfg.settings; + } // cfg.settings; }; # monitoring is not really useful, because it only contains the http-worker infos -> skipped for now diff --git a/modules/services/photos/default.nix b/modules/services/photos/default.nix index e062986..0c31d53 100644 --- a/modules/services/photos/default.nix +++ b/modules/services/photos/default.nix @@ -43,8 +43,7 @@ in settings = { ffmpeg.transcode = "disabled"; server.externalDomain = "https://photos.${domain}"; - } - // cfg.settings; + } // cfg.settings; environment = { IMMICH_TELEMETRY_INCLUDE = "all"; IMMICH_API_METRICS_PORT = toString (port + 1);