File tree 4 files changed +37
-5
lines changed
4 files changed +37
-5
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,6 @@ matrix:
14
14
- env : BASE_OS=debian
15
15
16
16
script :
17
- - docker build --pull -t fretlink/nix ${BASE_OS}/
17
+ - docker build --pull -t fretlink/nix -f ${BASE_OS}/Dockerfile .
18
18
- docker run -it --rm fretlink/nix 'nix-channel --list'
19
19
- docker run -it --rm fretlink/nix 'nix-env -iA nixpkgs.hello && test "$(hello)" = "Hello, world!"'
Original file line number Diff line number Diff line change @@ -36,8 +36,17 @@ RUN nix-channel --add https://nixos.org/channels/nixpkgs-19.09-darwin nixpkgs \
36
36
# Propagate UTF8
37
37
# https://github.com/NixOS/nix/issues/599#issuecomment-153885553
38
38
# The same is hapenning with stack2nix
39
- RUN nix-env -iA nixpkgs.glibcLocales \
40
- && echo "export LOCALE_ARCHIVE=$(nix-env --installed --no-name --out-path --query glibc-locales)/lib/locale/locale-archive" >> ${HOME}/.profile
39
+ RUN nix-env -iA nixpkgs.glibcLocales
40
+
41
+ # < Nix context 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
45
+ RUN cp -R /nix /home/nixuser/initial-nix
46
+ VOLUME ["/nix" ]
47
+ # Create bash profile
48
+ COPY --chown=nixuser:nixuser files/.profile ${HOME}/.profile
49
+ # />
41
50
42
51
# Make sure to use "login" shell when running container
43
52
ENTRYPOINT ["/usr/bin/env" , "bash" , "-l" , "-c" ]
Original file line number Diff line number Diff line change @@ -36,8 +36,17 @@ RUN nix-channel --add https://nixos.org/channels/nixpkgs-19.09-darwin nixpkgs \
36
36
# Propagate UTF8
37
37
# https://github.com/NixOS/nix/issues/599#issuecomment-153885553
38
38
# The same is hapenning with stack2nix
39
- RUN nix-env -iA nixpkgs.glibcLocales \
40
- && echo "export LOCALE_ARCHIVE=$(nix-env --installed --no-name --out-path --query glibc-locales)/lib/locale/locale-archive" >> ${HOME}/.profile
39
+ RUN nix-env -iA nixpkgs.glibcLocales
40
+
41
+ # < Nix context 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
45
+ RUN cp -R /nix /home/nixuser/initial-nix
46
+ VOLUME ["/nix" ]
47
+ # Create bash profile
48
+ COPY --chown=nixuser:nixuser files/.profile ${HOME}/.profile
49
+ # />
41
50
42
51
# Make sure to use "login" shell when running container
43
52
ENTRYPOINT ["/usr/bin/env" , "bash" , "-l" , "-c" ]
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
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
7
+ nix_profile=" /home/nixuser/.nix-profile/etc/profile.d/nix.sh"
8
+ # shellcheck source=/home/nixuser/.nix-profile/etc/profile.d/nix.sh
9
+ [ -e " ${nix_profile} " ] && . " ${nix_profile} "
10
+
11
+ # Propagate UTF8
12
+ # https://github.com/NixOS/nix/issues/599#issuecomment-153885553
13
+ LOCALE_ARCHIVE=" $( nix-env --installed --no-name --out-path --query glibc-locales) /lib/locale/locale-archive"
14
+ export LOCALE_ARCHIVE
You can’t perform that action at this time.
0 commit comments