]> git.immae.eu Git - github/fretlink/docker-nix.git/blobdiff - alpine/Dockerfile
Merge pull request #5 from haitlahcen/upgrade-19.03
[github/fretlink/docker-nix.git] / alpine / Dockerfile
index 1bf3a3b52ceec6fe4f19cc9893623ae504f8622a..c5d07b29832ac40a90e4701e15ebde9018bf54f2 100644 (file)
@@ -2,7 +2,7 @@
 FROM alpine
 
 ARG NIX_VERSION
-ENV NIX_VERSION ${NIX_VERSION:-2.1.3}
+ENV NIX_VERSION ${NIX_VERSION:-2.2.1}
 ARG LANG
 ENV LANG ${LANG:-"en_US.UTF-8"}
 
@@ -11,7 +11,9 @@ RUN addgroup -g 30000 -S nixbld \
     && adduser -D nixuser \
     && mkdir -m 0755 /nix && chown nixuser /nix \
     && apk add --no-cache bash \
-    && rm -rf /var/cache/apk/*
+    && rm -rf /var/cache/apk/* \
+    # sandboxing enabled by default since 2.2
+    && mkdir -p /etc/nix && echo 'sandbox = false' > /etc/nix/nix.conf
 
 USER nixuser
 ENV USER=nixuser
@@ -27,8 +29,9 @@ RUN echo ". ${ENV}" >> ${HOME}/.profile
 # All subsequent "RUN" will use a login shell
 SHELL ["/usr/bin/env", "bash", "-l", "-c"]
 
-RUN nix-channel --add https://nixos.org/channels/nixpkgs-18.09-darwin nixpkgs \
-  && nix-channel --update
+RUN nix-channel --add https://nixos.org/channels/nixpkgs-19.03-darwin nixpkgs \
+    && nix-channel --add https://nixos.org/channels/nixpkgs-unstable unstable \
+    && nix-channel --update
 
 # Propagate UTF8
 # https://github.com/NixOS/nix/issues/599#issuecomment-153885553