Created
June 26, 2020 07:24
-
-
Save Fusion/e38157ee4eff729a8d5cb047788e8e9e to your computer and use it in GitHub Desktop.
Installing nix in a container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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