summaryrefslogtreecommitdiff
path: root/hooks/pre-up/2-nix
blob: 19ba27957c6947be6095922ce38c08167d4588dd (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh

if ! [ -x "$(command -v nix)" ]; then
  echo "Installing Nix"
  doas install -d -m755 -o $(id -u) -g $(id -g) /nix
  doas xbps-install -y xz
  curl -L https://nixos.org/nix/install | sh
  echo "Nix has been installed, you should run nix profile install nixpkgs#nix-direnv once profile has been refreshed"
fi