From 11658621cc0673d78b6fa97c27cbbd1884574a4b Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Sun, 10 May 2026 16:53:14 +0200 Subject: [PATCH 01/27] misc --- modules/packages/sbb-tui.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/packages/sbb-tui.nix b/modules/packages/sbb-tui.nix index 815def8..5b19420 100644 --- a/modules/packages/sbb-tui.nix +++ b/modules/packages/sbb-tui.nix @@ -8,13 +8,13 @@ buildGoModule (finalAttrs: { pname = "sbb-tui"; - version = "1.14.1"; + version = "1.14.2"; __structuredAttrs = true; src = fetchFromGitHub { owner = "Necrom4"; repo = "sbb-tui"; tag = "v${finalAttrs.version}"; - hash = "sha256-nXkzy5PDR3MRrA0Hsh6/icjAbYyBR2q7oBn74ir1O3E="; + hash = lib.fakeHash; }; vendorHash = "sha256-K4DOu3rfSlKAa5JNKCzWWpnWZlXXxtN5Po7p1Spqe1w="; From e1af34b5ad7b0459f689b0f07db54c1ecc8274c6 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Sun, 10 May 2026 16:56:30 +0200 Subject: [PATCH 02/27] added bookmark --- modules/home-manager/librewolf.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/home-manager/librewolf.nix b/modules/home-manager/librewolf.nix index ce224f6..35ee3fb 100644 --- a/modules/home-manager/librewolf.nix +++ b/modules/home-manager/librewolf.nix @@ -314,6 +314,12 @@ keyword = "AI writing"; url = "https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing"; } + { + name = "nixpkgs-review-gha"; + tags = [ "nixpkgs-review" "gha" ]; + keyword = "nixpkgs-review"; + url = "https://github.com/tomasriveral/nixpkgs-review-gha/actions/workflows/review.yml"; + } ]; }; search = { From 3c14e59bfffb64e07be4ae87826f50bd316825ae Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Sun, 10 May 2026 17:00:30 +0200 Subject: [PATCH 03/27] cleanup --- hosts/laptop/configuration.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index e5cd095..f13da3b 100755 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -268,10 +268,10 @@ papirus-folders inkscape birdtray # thunderbird tray app - #vivify # for NoteWrapper + vivify # for NoteWrapper # this is more up to date - (callPackage ../../modules/packages/vivify.nix {}) - (callPackage ../../modules/packages/sbb-tui.nix {}) + #(callPackage ../../modules/packages/vivify.nix {}) + #(callPackage ../../modules/packages/sbb-tui.nix {}) pkgs-unstable.nixpkgs-review pkgs-unstable.nixfmt-tree pkgs-unstable.treefmt From ee82b5fce52086ba98191ec17bae1994fef559ba Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Sun, 10 May 2026 19:37:21 +0200 Subject: [PATCH 04/27] vivify: cleanup versions --- hosts/laptop/configuration.nix | 1 - modules/home-manager/vivify.nix | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index f13da3b..4e0aeb1 100755 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -268,7 +268,6 @@ papirus-folders inkscape birdtray # thunderbird tray app - vivify # for NoteWrapper # this is more up to date #(callPackage ../../modules/packages/vivify.nix {}) #(callPackage ../../modules/packages/sbb-tui.nix {}) diff --git a/modules/home-manager/vivify.nix b/modules/home-manager/vivify.nix index ae19b3b..1074d4f 100644 --- a/modules/home-manager/vivify.nix +++ b/modules/home-manager/vivify.nix @@ -1,6 +1,5 @@ { - config, - pkgs, + pkgs-unstable, ... }: { home.file.".config/vivify/config.json" = { @@ -13,6 +12,9 @@ } }''; }; +home.packages = [ + pkgs-unstable.vivify +]; programs.qutebrowser = { enable = true; settings = { From 60511e05f856ce0007a243b92ab203ce738073db Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Tue, 12 May 2026 19:30:02 +0200 Subject: [PATCH 05/27] updated flake --- flake.lock | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/flake.lock b/flake.lock index d704c3d..8627806 100755 --- a/flake.lock +++ b/flake.lock @@ -11,11 +11,11 @@ ] }, "locked": { - "lastModified": 1777726295, - "narHash": "sha256-Db9B3uTLDSj7zjQ4L3tIk9RcxHXbWRKw5fw8JozikyI=", + "lastModified": 1778125502, + "narHash": "sha256-QAAO9RCR6byVJi50l8RMVJWzrsNYbXonfR6tqU93vIQ=", "owner": "caelestia-dots", "repo": "cli", - "rev": "a00e71d6b7572a8dbbb7945a45b79acf2401ad56", + "rev": "7b8a4281aa8b2b12745de531cce0c65d87aea2e5", "type": "github" }, "original": { @@ -33,11 +33,11 @@ "quickshell": "quickshell" }, "locked": { - "lastModified": 1777891103, - "narHash": "sha256-/b87CUV9NEh4YYtG6tGGbbSJurqkfwZQ5rZNiIBJWYw=", + "lastModified": 1778381004, + "narHash": "sha256-JwIlrajiY74obxyTMu/Ym6wOEQaCjpHwfziPK+E5u3Q=", "owner": "caelestia-dots", "repo": "shell", - "rev": "54cdd80c1b7671deeb057cc554f83e436765596a", + "rev": "2ca4ad4a434e91e73504debd5225e66dc5ebb2b6", "type": "github" }, "original": { @@ -53,11 +53,11 @@ ] }, "locked": { - "lastModified": 1777851538, - "narHash": "sha256-Gp8qwTEYNoy2yvmErVGlvLOQvrtEECCAKbonW7VJef8=", + "lastModified": 1778606796, + "narHash": "sha256-P2krpSkFVYJ89bgsnAZ9RtQiGwiTW77sfSJp9SEDscM=", "owner": "nix-community", "repo": "home-manager", - "rev": "cc09c0f9b7eaa95c2d9827338a5eb03d32505ca5", + "rev": "e1fd7350f4410972bcb8c42a697d8c924ffe642a", "type": "github" }, "original": { @@ -119,11 +119,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1777826146, - "narHash": "sha256-wQ/iN5Zp5VIa3ebBibijPnLyKhor+xEbDy4d0goa9Zs=", + "lastModified": 1778551015, + "narHash": "sha256-j299xXVjlKs5WtVkKSgEXZGvpTTw5X2iWwKs4KWv/Ag=", "owner": "nixos", "repo": "nixpkgs", - "rev": "73c703c22422b8951895a960959dbbaca7296492", + "rev": "0a0bf409f3593f415d0a554f33acc63dc7dccb43", "type": "github" }, "original": { @@ -135,11 +135,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1777673416, - "narHash": "sha256-5c2POKPOjU40Kh0MirOdScBLG0bu9TAuPYAtPRNZMBs=", + "lastModified": 1778430510, + "narHash": "sha256-Ti+ZBvW6yrWWAg2szExVTwCd4qOJ3KlVr1tFHfyfi8Q=", "owner": "nixos", "repo": "nixpkgs", - "rev": "26ef669cffa904b6f6832ab57b77892a37c1a671", + "rev": "8fd9daa3db09ced9700431c5b7ad0e8ba199b575", "type": "github" }, "original": { @@ -157,11 +157,11 @@ ] }, "locked": { - "lastModified": 1777706159, - "narHash": "sha256-TuD8hw9lkRCEb+6v93iB7HDvcmvH8R0qyD6wBmPGfv8=", + "lastModified": 1778222427, + "narHash": "sha256-6GFiP611nEJvtm+m03sMyfaVIJ9QOCi//hS+PPKyyPA=", "ref": "refs/heads/master", - "rev": "8db8ca1fecfcce8def1f9265fa1742baa0e0c271", - "revCount": 813, + "rev": "d1760ed1f31c02a95b37a9bf4084129c829ebe7f", + "revCount": 817, "type": "git", "url": "https://git.outfoxxed.me/outfoxxed/quickshell" }, From 989c59db11f6047c6260eeb0f54ba56f22042302 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Tue, 12 May 2026 19:59:29 +0200 Subject: [PATCH 06/27] updated snrs and snrt to use time --- hostsModules/laptop/home-manager/zsh.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hostsModules/laptop/home-manager/zsh.nix b/hostsModules/laptop/home-manager/zsh.nix index 3718598..7ff0679 100644 --- a/hostsModules/laptop/home-manager/zsh.nix +++ b/hostsModules/laptop/home-manager/zsh.nix @@ -5,8 +5,8 @@ }: { programs.zsh = { shellAliases = { - snrt = "git add -A && sudo nixos-rebuild test --flake ~/nixos/#laptop"; - snrs = "git add -A && sudo nixos-rebuild switch --flake ~/nixos/#laptop"; + snrt = "git add -A && time sudo nixos-rebuild test --flake ~/nixos/#laptop"; + snrs = "git add -A && time sudo nixos-rebuild switch --flake ~/nixos/#laptop"; }; }; } From 7f4508ecc956724df3e3d7a0b25a19f216b6ad1b Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Thu, 14 May 2026 11:09:30 +0200 Subject: [PATCH 07/27] matrix: replaced iamb by fluffychat --- hosts/laptop/configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 4e0aeb1..f4b3a54 100755 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -235,7 +235,7 @@ networkx scipy ])) - iamb # matrix client + fluffychat # matrix client direnv # utils for dev pkg-config From b069e49bc19dabf62b65cbac63be3471cb7098dd Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Thu, 14 May 2026 18:44:40 +0200 Subject: [PATCH 08/27] hyprland: remove splash --- modules/home-manager/hyprland.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/home-manager/hyprland.nix b/modules/home-manager/hyprland.nix index d935bca..4d9643b 100644 --- a/modules/home-manager/hyprland.nix +++ b/modules/home-manager/hyprland.nix @@ -234,7 +234,7 @@ in { ###################### */ ]; - splash = false; # remove default background on startup + splash = true; # remove default background on startup # gestures (also keybindings) gesture = [ "3, right, move, +col" From 7e31cd915d9440b070be5d200e1429871d0e3078 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 11:41:17 +0200 Subject: [PATCH 09/27] librewolf: add nixpkgs tracker as bookmark --- modules/home-manager/librewolf.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/home-manager/librewolf.nix b/modules/home-manager/librewolf.nix index 35ee3fb..0097dd7 100644 --- a/modules/home-manager/librewolf.nix +++ b/modules/home-manager/librewolf.nix @@ -320,6 +320,12 @@ keyword = "nixpkgs-review"; url = "https://github.com/tomasriveral/nixpkgs-review-gha/actions/workflows/review.yml"; } + { + name = "nixpkgs tracker"; + tags = [ "nixpkgs" "tracker" ]; + keyword = "nixpkgs tracker"; + url = "https://nixpk.gs/pr-tracker.html"; + } ]; }; search = { From 5bb9785a60db8e8e20e63075eff606905cdf26f7 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 13:35:54 +0200 Subject: [PATCH 10/27] matrix: add matrix-commander-rc --- hosts/laptop/configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index f4b3a54..268a7c9 100755 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -235,7 +235,7 @@ networkx scipy ])) - fluffychat # matrix client + fluffychat matrix-commander-rs # matrix client direnv # utils for dev pkg-config From cc2e44afefe1134b98ac162f340a0deaab52d2a7 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 14:48:23 +0200 Subject: [PATCH 11/27] flake: autoupdate 2026-05-15T12-48-16Z --- flake.lock | 6 ++-- hosts/laptop/home.nix | 6 ++++ hostsModules/laptop/scripts/autoUpdate.nix | 40 +++++++++++++++++++++ hostsModules/laptop/scripts/checkMatrix.nix | 21 +++++++++++ modules/home-manager/hyprland.nix | 1 + 5 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 hostsModules/laptop/scripts/autoUpdate.nix create mode 100644 hostsModules/laptop/scripts/checkMatrix.nix diff --git a/flake.lock b/flake.lock index 8627806..d53e0c1 100755 --- a/flake.lock +++ b/flake.lock @@ -119,11 +119,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1778551015, - "narHash": "sha256-j299xXVjlKs5WtVkKSgEXZGvpTTw5X2iWwKs4KWv/Ag=", + "lastModified": 1778794387, + "narHash": "sha256-BL04pOS9453Awkeb9f90XBJXBSkWxN+vB7HIgnL0iMM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0a0bf409f3593f415d0a554f33acc63dc7dccb43", + "rev": "8a1b0127302ea51e05bf4ea5a291743fac442406", "type": "github" }, "original": { diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 236732d..d23d07e 100755 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -68,6 +68,12 @@ (pkgs.callPackage ../../modules/scripts/dontkillsteam.nix {}) # kill app (if it is steam put it in some background (pkgs.callPackage ../../hostsModules/laptop/scripts/batterynotify.nix {}) (pkgs.callPackage ../../hostsModules/laptop/scripts/batterywarning.nix {}) + + # checks if matrix-commander-rs is installed and logged in + (pkgs.callPackage ../../hostsModules/laptop/scripts/checkMatrix.nix {}) + # autoupdate the flake and send notification to system and to matrix + (pkgs.callPackage ../../hostsModules/laptop/scripts/autoUpdate.nix {}) + (pkgs.callPackage ../../modules/scripts/weather.nix {}) (pkgs.callPackage ../../modules/scripts/wallpaper.nix {}) (pkgs.callPackage ../../modules/scripts/mountkdrive.nix {}) diff --git a/hostsModules/laptop/scripts/autoUpdate.nix b/hostsModules/laptop/scripts/autoUpdate.nix new file mode 100644 index 0000000..cd80e8f --- /dev/null +++ b/hostsModules/laptop/scripts/autoUpdate.nix @@ -0,0 +1,40 @@ +{ + pkgs, + ... +}: +pkgs.writeShellApplication { + name = "custom-autoupdate"; + + runtimeInputs = with pkgs; [ + git + nixos-rebuild + matrix-commander-rs + libnotify + ]; + + text = '' + set -e + + FLAKE_DIR="/home/tomasr/nixos" + FLAKE="$FLAKE_DIR#laptop" + TIME=$(date -u +"%Y-%m-%dT%H-%M-%SZ") + + git -C "$FLAKE_DIR" pull + git -C "$FLAKE_DIR" tag "pre-autoupdate-$TIME" + + nix flake update --flake "$FLAKE_DIR" + + if sudo nixos-rebuild switch --flake "$FLAKE"; then + git -C "$FLAKE_DIR" add flake.lock + git -C "$FLAKE_DIR" commit -m "flake: autoupdate $TIME" + git -C "$FLAKE_DIR" push + + notify-send "Flake autoupdate" "Rebuild OK" + matrix-commander-rs -m "Flake rebuild OK" + else + notify-send -u critical "Flake autoupdate" "FAILED" + matrix-commander-rs -m "Flake rebuild FAILED" + git reset --hard "pre-autoupdate-$TIME" + fi + ''; +} diff --git a/hostsModules/laptop/scripts/checkMatrix.nix b/hostsModules/laptop/scripts/checkMatrix.nix new file mode 100644 index 0000000..177ca7a --- /dev/null +++ b/hostsModules/laptop/scripts/checkMatrix.nix @@ -0,0 +1,21 @@ +{ pkgs }: + +pkgs.writeShellApplication { + name = "custom-checkMatrix"; + + runtimeInputs = [ + pkgs.matrix-commander-rs + pkgs.libnotify + ]; + + text = '' + expected="@totorile1:unredacted.org" + + current="$(matrix-commander-rs --whoami | tr -d '\n')" + + if [ "$current" != "$expected" ]; then + notify-send "matrix-commander-rs" \ + "You are not logged in as @totorile1:unredacted.org\nLog:\n$current" + fi + ''; +} diff --git a/modules/home-manager/hyprland.nix b/modules/home-manager/hyprland.nix index 4d9643b..4e08037 100644 --- a/modules/home-manager/hyprland.nix +++ b/modules/home-manager/hyprland.nix @@ -218,6 +218,7 @@ in { "custom-mountkdrive" #"waybar" "custom-gitnotify" + "custom-checkMatrix" # checks if matrix-commander-rs is connected which is important for other stuff #"custom-obsidianbackup" # backups the obsidian notes to kdrive and to a timed hidden dir (~/.Notes.backup/) #"QS-notifycache" # builds the cache that will be used for the notification history "sleep 4 & caelestia-shell" #works better if it sleeps a bit before From 093a084e48321a13db3b8fd839538e4bc20dc0b3 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 14:51:50 +0200 Subject: [PATCH 12/27] flake: autoupdate 2026-05-15T12-51-46Z --- hostsModules/laptop/scripts/autoUpdate.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hostsModules/laptop/scripts/autoUpdate.nix b/hostsModules/laptop/scripts/autoUpdate.nix index cd80e8f..08411b8 100644 --- a/hostsModules/laptop/scripts/autoUpdate.nix +++ b/hostsModules/laptop/scripts/autoUpdate.nix @@ -25,12 +25,13 @@ pkgs.writeShellApplication { nix flake update --flake "$FLAKE_DIR" if sudo nixos-rebuild switch --flake "$FLAKE"; then + git -C "$FLAKE_DIR" restore . git -C "$FLAKE_DIR" add flake.lock git -C "$FLAKE_DIR" commit -m "flake: autoupdate $TIME" git -C "$FLAKE_DIR" push notify-send "Flake autoupdate" "Rebuild OK" - matrix-commander-rs -m "Flake rebuild OK" + matrix-commander-rs -m "Flake rebuild succesfull.
@notificationbot_0000" --html -r "\!7j-78_02dHROeLj4Ns8F12eo4IiZGv4zNsQ_1-WlyIU" else notify-send -u critical "Flake autoupdate" "FAILED" matrix-commander-rs -m "Flake rebuild FAILED" From 2c157b34e916fcc50f2242fa789caf0b33b741a4 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 14:57:09 +0200 Subject: [PATCH 13/27] flake: autoupdate 2026-05-15T12-57-04Z --- hostsModules/laptop/scripts/autoUpdate.nix | 25 +++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/hostsModules/laptop/scripts/autoUpdate.nix b/hostsModules/laptop/scripts/autoUpdate.nix index 08411b8..4da52bd 100644 --- a/hostsModules/laptop/scripts/autoUpdate.nix +++ b/hostsModules/laptop/scripts/autoUpdate.nix @@ -19,23 +19,32 @@ pkgs.writeShellApplication { FLAKE="$FLAKE_DIR#laptop" TIME=$(date -u +"%Y-%m-%dT%H-%M-%SZ") - git -C "$FLAKE_DIR" pull - git -C "$FLAKE_DIR" tag "pre-autoupdate-$TIME" + ERROR_FILE=$(mktemp) - nix flake update --flake "$FLAKE_DIR" - - if sudo nixos-rebuild switch --flake "$FLAKE"; then + if sudo nixos-rebuild switch --flake "$FLAKE" 2> "$ERROR_FILE"; then git -C "$FLAKE_DIR" restore . git -C "$FLAKE_DIR" add flake.lock git -C "$FLAKE_DIR" commit -m "flake: autoupdate $TIME" git -C "$FLAKE_DIR" push notify-send "Flake autoupdate" "Rebuild OK" - matrix-commander-rs -m "Flake rebuild succesfull.
@notificationbot_0000" --html -r "\!7j-78_02dHROeLj4Ns8F12eo4IiZGv4zNsQ_1-WlyIU" + + matrix-commander-rs -m "Flake rebuild succesfull.
@notificationbot_0000" \ + --html \ + -r "\!7j-78_02dHROeLj4Ns8F12eo4IiZGv4zNsQ_1-WlyIU" + else + ERROR_MSG=$(cat "$ERROR_FILE") + notify-send -u critical "Flake autoupdate" "FAILED" - matrix-commander-rs -m "Flake rebuild FAILED" - git reset --hard "pre-autoupdate-$TIME" + + matrix-commander-rs -m "Flake rebuild failed.
Error:
$ERROR_MSG

@notificationbot_0000" \ + --html \ + -r "\!7j-78_02dHROeLj4Ns8F12eo4IiZGv4zNsQ_1-WlyIU" + + git -C "$FLAKE_DIR" reset --hard "pre-autoupdate-$TIME" fi + + rm -f "$ERROR_FILE" ''; } From 6bcf00d928d22794b4d362991c20de7bd83d589b Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 15:10:28 +0200 Subject: [PATCH 14/27] snapshot pre-autoupdate-2026-05-15T13-10-28Z --- hostsModules/laptop/scripts/autoUpdate.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hostsModules/laptop/scripts/autoUpdate.nix b/hostsModules/laptop/scripts/autoUpdate.nix index 4da52bd..7b7ebdb 100644 --- a/hostsModules/laptop/scripts/autoUpdate.nix +++ b/hostsModules/laptop/scripts/autoUpdate.nix @@ -21,10 +21,18 @@ pkgs.writeShellApplication { ERROR_FILE=$(mktemp) + # snapshot current state + git -C "$FLAKE_DIR" add -A + git -C "$FLAKE_DIR" commit --allow-empty -m "snapshot pre-autoupdate-$TIME" + git -C "$FLAKE_DIR" tag "pre-autoupdate-$TIME" HEAD + + # update lock only + nix flake update --flake "$FLAKE_DIR" + if sudo nixos-rebuild switch --flake "$FLAKE" 2> "$ERROR_FILE"; then - git -C "$FLAKE_DIR" restore . + git -C "$FLAKE_DIR" add flake.lock - git -C "$FLAKE_DIR" commit -m "flake: autoupdate $TIME" + git -C "$FLAKE_DIR" commit -m "flake.lock: autoupdate-$TIME" git -C "$FLAKE_DIR" push notify-send "Flake autoupdate" "Rebuild OK" From 918204ee62885790d00c3a2cac37c816529e9496 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 15:13:18 +0200 Subject: [PATCH 15/27] snapshot pre-autoupdate-2026-05-15T13-13-18Z --- hostsModules/laptop/scripts/autoUpdate.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hostsModules/laptop/scripts/autoUpdate.nix b/hostsModules/laptop/scripts/autoUpdate.nix index 7b7ebdb..29ba7a3 100644 --- a/hostsModules/laptop/scripts/autoUpdate.nix +++ b/hostsModules/laptop/scripts/autoUpdate.nix @@ -52,7 +52,8 @@ pkgs.writeShellApplication { git -C "$FLAKE_DIR" reset --hard "pre-autoupdate-$TIME" fi - + + git -C "$FLAKE_DIR" push rm -f "$ERROR_FILE" ''; } From c727fa412fb9ed3dc6ba6e22ba65deff4ff161d7 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 15:17:52 +0200 Subject: [PATCH 16/27] snapshot pre-autoupdate-2026-05-15T13-17-52Z --- hostsModules/laptop/scripts/autoUpdate.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hostsModules/laptop/scripts/autoUpdate.nix b/hostsModules/laptop/scripts/autoUpdate.nix index 29ba7a3..b1eabf9 100644 --- a/hostsModules/laptop/scripts/autoUpdate.nix +++ b/hostsModules/laptop/scripts/autoUpdate.nix @@ -37,7 +37,7 @@ pkgs.writeShellApplication { notify-send "Flake autoupdate" "Rebuild OK" - matrix-commander-rs -m "Flake rebuild succesfull.
@notificationbot_0000" \ + matrix-commander-rs --verbose -m "Flake rebuild succesfull.
@notificationbot_0000" \ --html \ -r "\!7j-78_02dHROeLj4Ns8F12eo4IiZGv4zNsQ_1-WlyIU" @@ -46,7 +46,7 @@ pkgs.writeShellApplication { notify-send -u critical "Flake autoupdate" "FAILED" - matrix-commander-rs -m "Flake rebuild failed.
Error:
$ERROR_MSG

@notificationbot_0000" \ + matrix-commander-rs --verbose -m "Flake rebuild failed.
Error:
$ERROR_MSG

@notificationbot_0000" \ --html \ -r "\!7j-78_02dHROeLj4Ns8F12eo4IiZGv4zNsQ_1-WlyIU" From e598b47389e5a132a3d99fbccbbe32fefac04dc6 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 15:19:53 +0200 Subject: [PATCH 17/27] flake.lock: autoupdate-2026-05-15T13-17-52Z --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index d53e0c1..07f8afd 100755 --- a/flake.lock +++ b/flake.lock @@ -135,11 +135,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1778430510, - "narHash": "sha256-Ti+ZBvW6yrWWAg2szExVTwCd4qOJ3KlVr1tFHfyfi8Q=", + "lastModified": 1778737229, + "narHash": "sha256-6xWoytx8jFW4PF1GjRm/i/53trbpKGfz6zjzQGBr4cI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "8fd9daa3db09ced9700431c5b7ad0e8ba199b575", + "rev": "d7a713c0b7e47c908258e71cba7a2d77cc8d71d5", "type": "github" }, "original": { From 2e863e67d9e7c759099f30b1337f20a3679e2a83 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 15:26:22 +0200 Subject: [PATCH 18/27] snapshot pre-autoupdate-2026-05-15T13-26-22Z --- hostsModules/laptop/scripts/autoUpdate.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hostsModules/laptop/scripts/autoUpdate.nix b/hostsModules/laptop/scripts/autoUpdate.nix index b1eabf9..5d0b792 100644 --- a/hostsModules/laptop/scripts/autoUpdate.nix +++ b/hostsModules/laptop/scripts/autoUpdate.nix @@ -10,6 +10,7 @@ pkgs.writeShellApplication { nixos-rebuild matrix-commander-rs libnotify + sudo ]; text = '' From 06ed68e4e5bb330cf70d43508717c15d0fe69705 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 15:30:18 +0200 Subject: [PATCH 19/27] snapshot pre-autoupdate-2026-05-15T13-30-18Z --- hosts/laptop/configuration.nix | 14 ++++++++++++++ hostsModules/laptop/scripts/autoUpdate.nix | 1 - 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 268a7c9..0992291 100755 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -162,6 +162,20 @@ shell = pkgs.zsh; }; + # removes need for password for nixos-rebuild + security.sudo.extraRules = [ + { + users = [ "tomasr" ]; + commands = [ + { + command = "/run/current-system/sw/bin/nixos-rebuild"; + options = [ "NOPASSWD" ]; + } + ]; + } + ]; + + #adds nixos experimental features: nix.settings.experimental-features = ["nix-command" "flakes"]; diff --git a/hostsModules/laptop/scripts/autoUpdate.nix b/hostsModules/laptop/scripts/autoUpdate.nix index 5d0b792..b1eabf9 100644 --- a/hostsModules/laptop/scripts/autoUpdate.nix +++ b/hostsModules/laptop/scripts/autoUpdate.nix @@ -10,7 +10,6 @@ pkgs.writeShellApplication { nixos-rebuild matrix-commander-rs libnotify - sudo ]; text = '' From 9ce8df2f980b5cdd161ab099da2d27952c1245b9 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 15:31:31 +0200 Subject: [PATCH 20/27] snapshot pre-autoupdate-2026-05-15T13-31-31Z From 7d0041f5c94a86dd5c8953f5c2febfac98012c40 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 15:36:59 +0200 Subject: [PATCH 21/27] snapshot pre-autoupdate-2026-05-15T13-36-59Z --- hostsModules/laptop/scripts/autoUpdate.nix | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/hostsModules/laptop/scripts/autoUpdate.nix b/hostsModules/laptop/scripts/autoUpdate.nix index b1eabf9..68ee3c6 100644 --- a/hostsModules/laptop/scripts/autoUpdate.nix +++ b/hostsModules/laptop/scripts/autoUpdate.nix @@ -30,16 +30,21 @@ pkgs.writeShellApplication { nix flake update --flake "$FLAKE_DIR" if sudo nixos-rebuild switch --flake "$FLAKE" 2> "$ERROR_FILE"; then + + if git -C "$FLAKE_DIR" diff --quiet; then + git -C "$FLAKE_DIR" add flake.lock + git -C "$FLAKE_DIR" commit -m "flake.lock: autoupdate-$TIME" + git -C "$FLAKE_DIR" push - git -C "$FLAKE_DIR" add flake.lock - git -C "$FLAKE_DIR" commit -m "flake.lock: autoupdate-$TIME" - git -C "$FLAKE_DIR" push + notify-send "Flake autoupdate" "Rebuild OK" - notify-send "Flake autoupdate" "Rebuild OK" - - matrix-commander-rs --verbose -m "Flake rebuild succesfull.
@notificationbot_0000" \ - --html \ - -r "\!7j-78_02dHROeLj4Ns8F12eo4IiZGv4zNsQ_1-WlyIU" + matrix-commander-rs --verbose -m "Flake rebuild succesfull.
@notificationbot_0000" \ + --html \ + -r "\!7j-78_02dHROeLj4Ns8F12eo4IiZGv4zNsQ_1-WlyIU" + else + notify-send "Flake autoupdate" "No changes" + git -C "$FLAKE_DIR" push + fi else ERROR_MSG=$(cat "$ERROR_FILE") @@ -53,7 +58,6 @@ pkgs.writeShellApplication { git -C "$FLAKE_DIR" reset --hard "pre-autoupdate-$TIME" fi - git -C "$FLAKE_DIR" push rm -f "$ERROR_FILE" ''; } From f2286d92047a8747afb461865ef33b078f5125d4 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 15:38:03 +0200 Subject: [PATCH 22/27] snapshot pre-autoupdate-2026-05-15T13-38-03Z From 1ba4e8f097ad637dd03084df93878537a12828b2 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 15:40:29 +0200 Subject: [PATCH 23/27] snapshot pre-autoupdate-2026-05-15T13-40-29Z From 08d741217aa5c3672083e4951a91f85040a38582 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 15:42:52 +0200 Subject: [PATCH 24/27] snapshot pre-autoupdate-2026-05-15T13-42-52Z --- hostsModules/laptop/scripts/autoUpdate.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hostsModules/laptop/scripts/autoUpdate.nix b/hostsModules/laptop/scripts/autoUpdate.nix index 68ee3c6..b1e2be1 100644 --- a/hostsModules/laptop/scripts/autoUpdate.nix +++ b/hostsModules/laptop/scripts/autoUpdate.nix @@ -31,7 +31,7 @@ pkgs.writeShellApplication { if sudo nixos-rebuild switch --flake "$FLAKE" 2> "$ERROR_FILE"; then - if git -C "$FLAKE_DIR" diff --quiet; then + if ! git -C "$FLAKE_DIR" diff --quiet; then git -C "$FLAKE_DIR" add flake.lock git -C "$FLAKE_DIR" commit -m "flake.lock: autoupdate-$TIME" git -C "$FLAKE_DIR" push From 151b134262c1505ed8018fef3e6562cbb16a7035 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 15:43:14 +0200 Subject: [PATCH 25/27] snapshot pre-autoupdate-2026-05-15T13-43-14Z From 9b15ec3f9ba7c9e53e2fa8d35732414013999c32 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 15:44:56 +0200 Subject: [PATCH 26/27] snapshot pre-autoupdate-2026-05-15T13-44-56Z --- hostsModules/laptop/scripts/autoUpdate.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hostsModules/laptop/scripts/autoUpdate.nix b/hostsModules/laptop/scripts/autoUpdate.nix index b1e2be1..5828ede 100644 --- a/hostsModules/laptop/scripts/autoUpdate.nix +++ b/hostsModules/laptop/scripts/autoUpdate.nix @@ -31,7 +31,7 @@ pkgs.writeShellApplication { if sudo nixos-rebuild switch --flake "$FLAKE" 2> "$ERROR_FILE"; then - if ! git -C "$FLAKE_DIR" diff --quiet; then + if ! git -C "$FLAKE_DIR" diff --quiet -- flake.lock; then git -C "$FLAKE_DIR" add flake.lock git -C "$FLAKE_DIR" commit -m "flake.lock: autoupdate-$TIME" git -C "$FLAKE_DIR" push From dcca37ab19cf5007cc2f2bbf9fe4a6405f1e2c04 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Fri, 15 May 2026 15:59:31 +0200 Subject: [PATCH 27/27] autoupdate: set up a systemd timer --- hosts/laptop/configuration.nix | 3 +- hosts/laptop/home.nix | 2 - hostsModules/laptop/nixos/autoUpdate.nix | 47 ++++++++++++++++++ modules/nixos/autoUpdate.nix | 62 ++++++++++++++++++++++++ 4 files changed, 111 insertions(+), 3 deletions(-) create mode 100644 hostsModules/laptop/nixos/autoUpdate.nix create mode 100644 modules/nixos/autoUpdate.nix diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 0992291..baa3f6b 100755 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -22,7 +22,8 @@ ../../hostsModules/laptop/nixos/disk.nix ../../modules/nixos/printer.nix ../../hostsModules/laptop/nixos/ollama.nix # llm config - ../../modules/nixos/mullvad.nix # vpn config + ../../modules/nixos/mullvad.nix # vpn config + ../../hostsModules/laptop/nixos/autoUpdate.nix # auto update the flakes. Handles notification via libnotify and matrix-commander-rs ]; diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index d23d07e..2b5d28e 100755 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -71,8 +71,6 @@ # checks if matrix-commander-rs is installed and logged in (pkgs.callPackage ../../hostsModules/laptop/scripts/checkMatrix.nix {}) - # autoupdate the flake and send notification to system and to matrix - (pkgs.callPackage ../../hostsModules/laptop/scripts/autoUpdate.nix {}) (pkgs.callPackage ../../modules/scripts/weather.nix {}) (pkgs.callPackage ../../modules/scripts/wallpaper.nix {}) diff --git a/hostsModules/laptop/nixos/autoUpdate.nix b/hostsModules/laptop/nixos/autoUpdate.nix new file mode 100644 index 0000000..eb46b5d --- /dev/null +++ b/hostsModules/laptop/nixos/autoUpdate.nix @@ -0,0 +1,47 @@ +{ pkgs, ... }: + +{ + # Ensure your script is available system-wide + environment.systemPackages = [ + (pkgs.callPackage ../scripts/autoUpdate.nix {}) + ]; + users.users.tomasr = { + linger = true; # lingering is required + }; + + systemd.user.services.custom-autoupdate = { + description = "NixOS flake auto update"; + + serviceConfig = { + Type = "oneshot"; + + ExecStart = "/run/current-system/sw/bin/custom-autoupdate"; + + # safety for long rebuilds + TimeoutStartSec = "45min"; + TimeoutStopSec = "10min"; + + # avoid overlap + RemainAfterExit = true; + + # tweaks that should make the system run normally during the rebuilds + Nice = 10; + IOSchedulingClass = "best-effort"; + IOSchedulingPriority = 7; + }; + }; + + # Systemd USER timer + systemd.user.timers.custom-autoupdate = { + wantedBy = [ "timers.target" ]; + + timerConfig = { + OnCalendar = "Fri *-*-* 20:00:00"; # runs friday night. If for whatever reason something breaks. I have whole week-end to fix it. + + Persistent = true; # if it happens during shutted down + + # avoids thundering herd on boot + RandomizedDelaySec = "2h"; + }; + }; +} diff --git a/modules/nixos/autoUpdate.nix b/modules/nixos/autoUpdate.nix new file mode 100644 index 0000000..30f743f --- /dev/null +++ b/modules/nixos/autoUpdate.nix @@ -0,0 +1,62 @@ +{ pkgs, ... }: + +{ + # Ensure your script is available system-wide + environment.systemPackages = [ + (pkgs.callPackage ./custom-autoupdate.nix {}) + ]; + + # ---------------------------- + # 🔥 Enable lingering for user services (IMPORTANT) + # ---------------------------- + users.users.tomasr = { + isNormalUser = true; + + # other config... + + linger = true; # <-- declarative equivalent of `loginctl enable-linger` + }; + + # ---------------------------- + # ✅ 2. Systemd USER service + # ---------------------------- + systemd.user.services.custom-autoupdate = { + description = "NixOS flake auto update"; + + serviceConfig = { + Type = "oneshot"; + + ExecStart = "/run/current-system/sw/bin/custom-autoupdate"; + + # safety for long rebuilds + TimeoutStartSec = "45min"; + TimeoutStopSec = "10min"; + + # avoid overlap + RemainAfterExit = true; + + # 🔥 recommended reliability tweaks + Nice = 10; + IOSchedulingClass = "best-effort"; + IOSchedulingPriority = 7; + }; + }; + + # ---------------------------- + # ⏱️ 3. Systemd USER timer + # ---------------------------- + systemd.user.timers.custom-autoupdate = { + wantedBy = [ "timers.target" ]; + + timerConfig = { + OnBootSec = "10min"; # run after boot + OnUnitActiveSec = "6h"; # every 6 hours + + # 🔥 ensures missed runs after shutdown happen + Persistent = true; + + # avoids thundering herd on boot + RandomizedDelaySec = "30min"; + }; + }; +}