-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·40 lines (37 loc) · 965 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
operation="switch"
systemname="${HOSTNAME:-default_system}"
while [[ "$#" -gt 0 ]]; do
case $1 in
--operation|-o)
if [[ -n $2 && $2 != -* ]]; then
operation="$2"; shift
else
echo "Error: --operation requires a non-empty option argument."
exit 1
fi
;;
--systemname|-s)
if [[ -n $2 && $2 != -* ]]; then
systemname="$2"; shift
else
echo "Error: --systemname requires a non-empty option argument."
exit 1
fi
;;
*)
echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
done
echo "Operation: $operation"
echo "System Name: $systemname"
git add -A
cd kalyx
git add -A
cd ..
cd kyler
git add -A
cd ..
nix flake lock --update-input kalyx
nix flake lock --update-input kyler
sudo nixos-rebuild $operation --flake ./#$systemname