mirror of
https://github.com/sadan4/dotfiles.git
synced 2025-06-27 06:28:20 -04:00
26 current 2024-04-21 19:57:03 24.05.20240419.5c24cf2 6.6.28 *
This commit is contained in:
commit
4b422ceacc
8 changed files with 427 additions and 0 deletions
32
build
Executable file
32
build
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
#Change to change box setup
|
||||
BOX="default"
|
||||
|
||||
pushd ~/nixos/
|
||||
|
||||
if git diff --quiet '*.nix' && [[ !( $1 =~ "*force*") ]] then
|
||||
echo "No changes. Exiting"
|
||||
# notify-send "No changes. Exiting"
|
||||
popd
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#TODO: Format files
|
||||
#format **
|
||||
|
||||
#show changes
|
||||
git diff -U0 '*.nix'
|
||||
|
||||
echo "Starting build"
|
||||
|
||||
sudo nixos-rebuild switch --flake .#${BOX} &> build.log || (cat build.log | grep --color error && notify-send "ERROR BUILDING NIX" && exit 1)
|
||||
|
||||
current=$(nixos-rebuild list-generations | grep current)
|
||||
|
||||
git commit -am "${current}"
|
||||
|
||||
popd
|
||||
notify-send -e "good build" --icon=software-update-okay
|
Loading…
Add table
Add a link
Reference in a new issue