Skip to content

Instantly share code, notes, and snippets.

@Fusion
Created June 26, 2020 07:24
Show Gist options
  • Save Fusion/e38157ee4eff729a8d5cb047788e8e9e to your computer and use it in GitHub Desktop.
Save Fusion/e38157ee4eff729a8d5cb047788e8e9e to your computer and use it in GitHub Desktop.
Installing nix in a container
#!/bin/bash
# Setting up nix in a container.
# While build users are created, this is a stadanlone,
# no daemon required, install.
# nix is touchy that way.
groupadd -r nixbld
for n in $(seq 1 10); do
useradd -c "Nix build user $n" \
-d /var/empty -g nixbld -G nixbld -M -N -r \
-s "$(which nologin)" nixbld$n
done
curl -L -o /tmp/install https://nixos.org/nix/install && \
chmod +x /tmp/install && \
/tmp/install
sed -i.bak -e '/^if/d' -e '/^fi/d' ~/.nix-profile/etc/profile.d/nix.sh
echo "Installed (maybe?)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment