]> git.immae.eu Git - github/fretlink/docker-nix.git/blobdiff - files/.profile
volume: change base images to be able to mount /nix/store as volume
[github/fretlink/docker-nix.git] / files / .profile
diff --git a/files/.profile b/files/.profile
new file mode 100755 (executable)
index 0000000..68b4473
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+# Copy initial saved nix context if the /nix is empty
+[ ! "$(ls -A /nix)" ] && cp -R ~/initial-nix/* /nix/
+
+# Source nix environment
+nix_profile="/home/nixuser/.nix-profile/etc/profile.d/nix.sh"
+# shellcheck source=/home/nixuser/.nix-profile/etc/profile.d/nix.sh
+[ -e "${nix_profile}" ] && . "${nix_profile}"
+
+# Propagate UTF8
+# https://github.com/NixOS/nix/issues/599#issuecomment-153885553
+LOCALE_ARCHIVE="$(nix-env --installed --no-name --out-path --query glibc-locales)/lib/locale/locale-archive"
+export LOCALE_ARCHIVE