1
0
Fork 0
dotfiles/home/programs/scripts/nixpkgs-switch

29 lines
480 B
Fish
Executable file

#!/usr/bin/env fish
set -f os (uname)
switch $os
case Darwin
set -f config_dir "$HOME/.config/nixpkgs"
case Linux
set -f config_dir /etc/nixos
case '*'
echo "Unsupported OS"
exit 1
end
pushd "$config_dir"
rm -rf result
switch $os
case Darwin
git pull
env TERM=xterm-256color darwin-rebuild switch --flake .
case Linux
sudo git pull
sudo nixos-rebuild switch --flake .
end
rm -f result
popd