diff options
author | Ismaël Bouya <ismael.bouya@fretlink.com> | 2020-12-16 17:07:17 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@fretlink.com> | 2020-12-16 17:07:50 +0100 |
commit | 62b9189f2da7d9b0804f38d564a1efed1e5db0fe (patch) | |
tree | af9525aa0344afcf089b9abcbfcfd337d33bd96a | |
parent | c33369a9ffa6945cc1928986ae280563d2ec0d85 (diff) | |
download | docker-nix-62b9189f2da7d9b0804f38d564a1efed1e5db0fe.tar.gz docker-nix-62b9189f2da7d9b0804f38d564a1efed1e5db0fe.tar.zst docker-nix-62b9189f2da7d9b0804f38d564a1efed1e5db0fe.zip |
Use a profile folder outside of /nix/var
-rw-r--r-- | alpine/Dockerfile | 1 | ||||
-rw-r--r-- | debian/Dockerfile | 1 | ||||
-rwxr-xr-x | files/.profile | 2 |
3 files changed, 3 insertions, 1 deletions
diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 5399610..f6ea60c 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile | |||
@@ -19,6 +19,7 @@ USER nixuser | |||
19 | ENV USER=nixuser | 19 | ENV USER=nixuser |
20 | ENV HOME="/home/nixuser" | 20 | ENV HOME="/home/nixuser" |
21 | ENV NIX_SYSTEM_PATH="/nix/var/nix/profiles/system" | 21 | ENV NIX_SYSTEM_PATH="/nix/var/nix/profiles/system" |
22 | ENV NIX_PROFILE="$HOME/nix-envs" | ||
22 | 23 | ||
23 | RUN cd && wget https://nixos.org/releases/nix/nix-$NIX_VERSION/nix-$NIX_VERSION-x86_64-linux.tar.xz \ | 24 | RUN cd && wget https://nixos.org/releases/nix/nix-$NIX_VERSION/nix-$NIX_VERSION-x86_64-linux.tar.xz \ |
24 | && tar xJf nix-*-x86_64-linux.tar.xz \ | 25 | && tar xJf nix-*-x86_64-linux.tar.xz \ |
diff --git a/debian/Dockerfile b/debian/Dockerfile index 52eb820..edc605c 100644 --- a/debian/Dockerfile +++ b/debian/Dockerfile | |||
@@ -19,6 +19,7 @@ USER nixuser | |||
19 | ENV USER=nixuser | 19 | ENV USER=nixuser |
20 | ENV HOME="/home/nixuser" | 20 | ENV HOME="/home/nixuser" |
21 | ENV NIX_SYSTEM_PATH="/nix/var/nix/profiles/system" | 21 | ENV NIX_SYSTEM_PATH="/nix/var/nix/profiles/system" |
22 | ENV NIX_PROFILE="$HOME/nix-envs" | ||
22 | 23 | ||
23 | RUN cd && wget https://nixos.org/releases/nix/nix-$NIX_VERSION/nix-$NIX_VERSION-x86_64-linux.tar.xz \ | 24 | RUN cd && wget https://nixos.org/releases/nix/nix-$NIX_VERSION/nix-$NIX_VERSION-x86_64-linux.tar.xz \ |
24 | && tar xJf nix-*-x86_64-linux.tar.xz \ | 25 | && tar xJf nix-*-x86_64-linux.tar.xz \ |
diff --git a/files/.profile b/files/.profile index e705bc0..80d968e 100755 --- a/files/.profile +++ b/files/.profile | |||
@@ -10,4 +10,4 @@ nix_profile="$NIX_SYSTEM_PATH/etc/profile.d/nix.sh" | |||
10 | LOCALE_ARCHIVE="$NIX_SYSTEM_PATH/lib/locale/locale-archive" | 10 | LOCALE_ARCHIVE="$NIX_SYSTEM_PATH/lib/locale/locale-archive" |
11 | export LOCALE_ARCHIVE | 11 | export LOCALE_ARCHIVE |
12 | 12 | ||
13 | PATH="$PATH:$NIX_SYSTEM_PATH/bin" | 13 | PATH="$NIX_PROFILE/bin:$PATH:$NIX_SYSTEM_PATH/bin" |