Skip to content

Commit

Permalink
Update install and uninstall scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Hoekstra <[email protected]>
  • Loading branch information
shoekstra committed Sep 12, 2023
1 parent 1f32ab6 commit eafa335
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ echo "==> Running first build..."
nix build "./nix#darwinConfigurations.$(hostname).system" --extra-experimental-features "nix-command flakes"

# Manual steps for nix-darwin to work with flakes
grep -q "private/var/run" /etc/synthetic.conf || printf 'run\tprivate/var/run\n' | sudo tee -a /etc/synthetic.conf
sudo grep -q "private/var/run" /etc/synthetic.conf || printf 'run\tprivate/var/run\n' | sudo tee -a /etc/synthetic.conf
/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -t

for file in /etc/bashrc /etc/nix/nix.conf /etc/zshrc; do
Expand All @@ -26,7 +26,9 @@ echo "==> Running first switch..."

./result/sw/bin/darwin-rebuild switch --flake ./nix

grep -q "/etc/static/zshrc" /etc/zshrc || echo 'if test -e /etc/static/zshrc; then . /etc/static/zshrc; fi' | sudo tee -a /etc/zshrc
if [ -e "/etc/zshrc" ]; then
grep -q "/etc/static/zshrc" /etc/zshrc || echo 'if test -e /etc/static/zshrc; then . /etc/static/zshrc; fi' | sudo tee -a /etc/zshrc
fi

echo "==> Setup complete!"
echo "Run \"darwin-rebuild switch --flake ./nix\" to rebuild your configuration after any changes"
4 changes: 3 additions & 1 deletion scripts/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ if [ -x "home-manager" ]; then
fi

echo "==> Uninstalling Nix..."
/nix/nix-installer uninstall
if [ -e "/nix/nix-installer" ]; then
/nix/nix-installer uninstall
fi

echo "==> Uninstall complete!"

0 comments on commit eafa335

Please sign in to comment.