Skip to content

Instantly share code, notes, and snippets.

@wilspi
Last active July 15, 2020 15:10
Show Gist options
  • Save wilspi/847b3794a5dda51a62b8bfd4fd968f3b to your computer and use it in GitHub Desktop.
Save wilspi/847b3794a5dda51a62b8bfd4fd968f3b to your computer and use it in GitHub Desktop.
Setup (nix)[https://nixos.org/nix/] on Arch Linux
#!/bin/sh
# Install nix via yay (AUR helper)
yay -S archlinux-nix
# Read: https://nixos.org/nix/manual/#ssec-multi-user
# Add nix builder groups
sudo groupadd -r nixbld
for n in $(seq 1 10); do sudo useradd -c "Nix build user $n" \
-d /var/empty -g nixbld -G nixbld -M -N -r -s "$(which nologin)" \
nixbld$n; done
# Source env variables
. /etc/profile.d/nix.sh
# Running the daemon
sudo nix-daemon & disown
export NIX_REMOTE=daemon
# Add and update channel
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
sudo nix-channel --update
nix-env -u
# Check if running
# nix-shell -p hello --run hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment