Create nix-flake-update.sh

This commit is contained in:
Dave Gallant
2024-02-21 19:56:36 -05:00
parent 616718705c
commit 0a44de200d
2 changed files with 10 additions and 5 deletions

View File

@@ -21,11 +21,7 @@ rollback:
nixos-rebuild --use-remote-sudo switch --rollback -I nixos-config="modules/machines/$(HOSTNAME)/configuration.nix" nixos-rebuild --use-remote-sudo switch --rollback -I nixos-config="modules/machines/$(HOSTNAME)/configuration.nix"
update: update:
nix flake update @./nix-flake-update.sh
make
git add .
git commit -S -m "nix flake update: $$(TZ=UTC date '+%Y-%m-%d %H:%M:%S %Z')"
git push
fmt: fmt:
alejandra . alejandra .

9
nix-flake-update.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
update_msg=$(nix flake update 2>&1 | grep -v 'warning:')
make
git add .
git commit -S -m "nix flake update: $(TZ=UTC date '+%Y-%m-%d %H:%M:%S %Z')
$update_msg"
git push