2022-08-02 19:01:17 +00:00
|
|
|
#!/usr/bin/env fish
|
|
|
|
|
2023-05-04 09:14:12 +00:00
|
|
|
set -f os (uname)
|
2022-08-02 19:01:17 +00:00
|
|
|
|
|
|
|
switch $os
|
|
|
|
case Darwin
|
2023-05-04 09:14:12 +00:00
|
|
|
set -f config_dir "$HOME/.config/nixpkgs"
|
2022-08-02 19:01:17 +00:00
|
|
|
case Linux
|
2023-05-04 09:14:12 +00:00
|
|
|
set -f config_dir /etc/nixos
|
2022-08-02 19:01:17 +00:00
|
|
|
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
|
|
|
|
|
2023-03-20 12:48:37 +00:00
|
|
|
rm -f result
|
2022-08-09 16:30:54 +00:00
|
|
|
|
2022-08-02 19:01:17 +00:00
|
|
|
popd
|