Last active
November 27, 2019 11:14
-
-
Save Br1ght0ne/e89dee5a4749f9a0891cb1ebd520a7ec to your computer and use it in GitHub Desktop.
Nix package manager on Alpine Edge
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
FROM alpine:edge | |
# Dependencies | |
RUN apk add curl | |
# Nix user and store setup | |
RUN adduser -D nix | |
RUN mkdir /nix | |
RUN chown nix /nix | |
# Switch to nix user | |
USER nix | |
ENV USER=nix | |
WORKDIR /home/nix | |
# Install Nix in single user mode | |
RUN curl https://nixos.org/nix/install > /tmp/nix-install.sh | |
RUN sh /tmp/nix-install.sh --no-daemon | |
# Add nix-* commands to PATH | |
RUN echo 'source /home/nix/.nix-profile/etc/profile.d/nix.sh' > .profile | |
# Update channels | |
RUN sh -l -c 'nix-channel --update' | |
# sh -l is needed to pick up .profile | |
CMD ["/bin/sh", "-l"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment