From 44ba0a6d5c3a9a1a6c77ba7b35eed6759360b122 Mon Sep 17 00:00:00 2001 From: chase Date: Wed, 28 May 2025 22:06:29 -0400 Subject: [PATCH] Started working on rebuild script --- .gitignore | 1 + home/home.nix | 2 ++ home/scripts/nixswitch.sh | 11 +++++++++++ 3 files changed, 14 insertions(+) create mode 100755 home/scripts/nixswitch.sh diff --git a/.gitignore b/.gitignore index c21993b..d946c7d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ smb-secrets +nixos-switch.log diff --git a/home/home.nix b/home/home.nix index 87e919a..8dc134f 100644 --- a/home/home.nix +++ b/home/home.nix @@ -269,4 +269,6 @@ in mpd.useLocal = true; }; + services.systembus-notify.enable = true; + } diff --git a/home/scripts/nixswitch.sh b/home/scripts/nixswitch.sh new file mode 100755 index 0000000..10aeeee --- /dev/null +++ b/home/scripts/nixswitch.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +cd ~/nixos-config + +sudo nixos-rebuild switch --flake . &>nixos-switch.log || (cat nixos-switch.log | grep --color error && exit 1) + +current=$(nixos-rebuild list-generations | grep current) + +git commit -am "$current" + +notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available +