aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorpaulrbr-fl <43074087+paulrbr-fl@users.noreply.github.com>2020-05-04 22:05:18 +0200
committerGitHub <noreply@github.com>2020-05-04 22:05:18 +0200
commit425ab813a99a2aec3c4ce5cc432356451aa343c3 (patch)
tree14468b6b65b39ed6af970708550da80d42a4fa59
parent937d660cdc7b7b82cc6e75641ee6f21ff43e017a (diff)
parente36f158f6547ea78da7926689cc6444f67b2a068 (diff)
downloaddocker-nix-425ab813a99a2aec3c4ce5cc432356451aa343c3.tar.gz
docker-nix-425ab813a99a2aec3c4ce5cc432356451aa343c3.tar.zst
docker-nix-425ab813a99a2aec3c4ce5cc432356451aa343c3.zip
Merge pull request #8 from paulrbr-fl/upgrade-nix2.3.4-channel-19.09
Nix upgrade to 2.3.4 and volume management tweak
-rw-r--r--alpine/Dockerfile5
-rw-r--r--debian/Dockerfile5
-rwxr-xr-xfiles/.profile3
3 files changed, 2 insertions, 11 deletions
diff --git a/alpine/Dockerfile b/alpine/Dockerfile
index 0e42345..2c4ae1f 100644
--- a/alpine/Dockerfile
+++ b/alpine/Dockerfile
@@ -2,7 +2,7 @@
2FROM alpine 2FROM alpine
3 3
4ARG NIX_VERSION 4ARG NIX_VERSION
5ENV NIX_VERSION ${NIX_VERSION:-2.3.1} 5ENV NIX_VERSION ${NIX_VERSION:-2.3.4}
6ARG LANG 6ARG LANG
7ENV LANG ${LANG:-"en_US.UTF-8"} 7ENV LANG ${LANG:-"en_US.UTF-8"}
8 8
@@ -40,9 +40,6 @@ RUN nix-env -iA nixpkgs.glibcLocales
40 40
41# < Nix context as a volume 41# < Nix context as a volume
42# We want to be able to define /nix/store as a volume 42# We want to be able to define /nix/store as a volume
43# We thus need to "save" the current nix context to be able
44# to restore it at startup time
45RUN cp -R /nix /home/nixuser/initial-nix
46VOLUME ["/nix"] 43VOLUME ["/nix"]
47# Create bash profile 44# Create bash profile
48COPY --chown=nixuser:nixuser files/.profile ${HOME}/.profile 45COPY --chown=nixuser:nixuser files/.profile ${HOME}/.profile
diff --git a/debian/Dockerfile b/debian/Dockerfile
index 90b2e65..e5d410e 100644
--- a/debian/Dockerfile
+++ b/debian/Dockerfile
@@ -2,7 +2,7 @@
2FROM debian:stable-slim 2FROM debian:stable-slim
3 3
4ARG NIX_VERSION 4ARG NIX_VERSION
5ENV NIX_VERSION ${NIX_VERSION:-2.3.1} 5ENV NIX_VERSION ${NIX_VERSION:-2.3.4}
6ARG LANG 6ARG LANG
7ENV LANG ${LANG:-"en_US.UTF-8"} 7ENV LANG ${LANG:-"en_US.UTF-8"}
8 8
@@ -40,9 +40,6 @@ RUN nix-env -iA nixpkgs.glibcLocales
40 40
41# < Nix context as a volume 41# < Nix context as a volume
42# We want to be able to define /nix/store as a volume 42# We want to be able to define /nix/store as a volume
43# We thus need to "save" the current nix context to be able
44# to restore it at startup time
45RUN cp -R /nix /home/nixuser/initial-nix
46VOLUME ["/nix"] 43VOLUME ["/nix"]
47# Create bash profile 44# Create bash profile
48COPY --chown=nixuser:nixuser files/.profile ${HOME}/.profile 45COPY --chown=nixuser:nixuser files/.profile ${HOME}/.profile
diff --git a/files/.profile b/files/.profile
index 68b4473..2fadec2 100755
--- a/files/.profile
+++ b/files/.profile
@@ -1,8 +1,5 @@
1#!/usr/bin/env bash 1#!/usr/bin/env bash
2 2
3# Copy initial saved nix context if the /nix is empty
4[ ! "$(ls -A /nix)" ] && cp -R ~/initial-nix/* /nix/
5
6# Source nix environment 3# Source nix environment
7nix_profile="/home/nixuser/.nix-profile/etc/profile.d/nix.sh" 4nix_profile="/home/nixuser/.nix-profile/etc/profile.d/nix.sh"
8# shellcheck source=/home/nixuser/.nix-profile/etc/profile.d/nix.sh 5# shellcheck source=/home/nixuser/.nix-profile/etc/profile.d/nix.sh