mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 02:28:37 +02:00
flake: autoupdate 2026-05-15T12-48-16Z
This commit is contained in:
Generated
+3
-3
@@ -119,11 +119,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1778551015,
|
"lastModified": 1778794387,
|
||||||
"narHash": "sha256-j299xXVjlKs5WtVkKSgEXZGvpTTw5X2iWwKs4KWv/Ag=",
|
"narHash": "sha256-BL04pOS9453Awkeb9f90XBJXBSkWxN+vB7HIgnL0iMM=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "0a0bf409f3593f415d0a554f33acc63dc7dccb43",
|
"rev": "8a1b0127302ea51e05bf4ea5a291743fac442406",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -68,6 +68,12 @@
|
|||||||
(pkgs.callPackage ../../modules/scripts/dontkillsteam.nix {}) # kill app (if it is steam put it in some background
|
(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/batterynotify.nix {})
|
||||||
(pkgs.callPackage ../../hostsModules/laptop/scripts/batterywarning.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/weather.nix {})
|
||||||
(pkgs.callPackage ../../modules/scripts/wallpaper.nix {})
|
(pkgs.callPackage ../../modules/scripts/wallpaper.nix {})
|
||||||
(pkgs.callPackage ../../modules/scripts/mountkdrive.nix {})
|
(pkgs.callPackage ../../modules/scripts/mountkdrive.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
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -218,6 +218,7 @@ in {
|
|||||||
"custom-mountkdrive"
|
"custom-mountkdrive"
|
||||||
#"waybar"
|
#"waybar"
|
||||||
"custom-gitnotify"
|
"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/)
|
#"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
|
#"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
|
"sleep 4 & caelestia-shell" #works better if it sleeps a bit before
|
||||||
|
|||||||
Reference in New Issue
Block a user