Last active
September 16, 2024 03:50
-
-
Save heywoodlh/535deea20a2a5b13339d1ee096bf6692 to your computer and use it in GitHub Desktop.
Commands to install Nix on new Alpine Linux host
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
# Enable the community repository | |
sed -i 's/#\(.*\/community\)/\1/' /etc/apk/repositories | |
# Install Nix package | |
apk add --no-cache nix shadow | |
# Assuming you're running as root | |
# Add user to the nix group | |
# Using shadow because I'm incompetent | |
myuser=heywoodlh | |
usermod -aG nix $myuser | |
# Configure Nix for flakes | |
cat <<EOF > /etc/nix/nix.conf | |
allowed-users = @nix | |
build-users-group = nixbld | |
max-jobs = 4 | |
extra-experimental-features = nix-command flakes | |
EOF | |
# Enable nix-daemon on boot | |
rc-update add nix-daemon | |
rc-service nix-daemon restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment