Skip to content

Instantly share code, notes, and snippets.

@puffnfresh
Last active February 22, 2023 04:22
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save puffnfresh/51634b71a44e14314e1c5808c932ee7f to your computer and use it in GitHub Desktop.
Save puffnfresh/51634b71a44e14314e1c5808c932ee7f to your computer and use it in GitHub Desktop.
Using Nix from AUR on Arch Linux
#!/bin/sh
## Or use an AUR helper, e.g.
## sudo aura -A nix
sudo pacman -S base-devel git
git clone https://aur.archlinux.org/nix.git
cd nix
makepkg -s
sudo pacman -U nix-*.pkg.tar.xz
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
. /etc/profile.d/nix.sh
sudo nix-daemon & disown
export NIX_REMOTE=daemon
## This is probably not ideal.
mkdir -p /nix/var/nix/profiles
sudo chown $(id -u):$(id -g) /nix/var/nix/profiles
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --update
nix-shell -p hello --run hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment