aboutsummaryrefslogblamecommitdiff
path: root/bin/update.sh
blob: 1593716810b47d96b312a0b5b5583f5516ad8eb0 (plain) (tree)
1
2
3
4
5
6
7
8
9

            
                  




                                          
                                     


                                        
                                                                                                          

                                                     
                                                     




                                     
#!/bin/sh -e

GREEN='\033[1;32m'
CLEAR='\033[0m'

export NIXPKGS_ALLOW_UNFREE=1

# Navigate to the directory of this script
cd "$(dirname "$(readlink -f "$0")")"
cd ..

echo "${GREEN}Starting build...${CLEAR}"
nix --experimental-features 'nix-command flakes' build .#darwinConfigurations."$(hostname -s)".system "$@"

echo "${GREEN}Switching to new generation...${CLEAR}"
./result/sw/bin/darwin-rebuild switch --flake .# "$@"

echo "${GREEN}Cleaning up...${CLEAR}"
unlink ./result

echo "${GREEN}Done${CLEAR}"