From 676ef103771aa3fc4b150290294b8ad5610d2750 Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Thu, 25 Oct 2018 00:30:34 +0900 Subject: Unify environment configuration and don't run in child shells This should enable `nix run` to work under shells like fish and zsh, as well as making child shells not needlessly reset any environment that should be inherited. Implementation adapted from NixOS. --- modules/programs/bash/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules/programs/bash') diff --git a/modules/programs/bash/default.nix b/modules/programs/bash/default.nix index ea5afe2..6f5c8e7 100644 --- a/modules/programs/bash/default.nix +++ b/modules/programs/bash/default.nix @@ -61,8 +61,9 @@ in # Don't execute this file when running in a pure nix-shell. if test -n "$IN_NIX_SHELL"; then return; fi - export PATH=${config.environment.systemPath} - ${config.system.build.setEnvironment.text} + if [ -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE" ]; then + . ${config.system.build.setEnvironment} + fi # Return early if not running interactively, but after basic nix setup. [[ $- != *i* ]] && return -- cgit v1.2.3