[Nix-dev] patch to allow switching profiles

roconnor at theorem.ca roconnor at theorem.ca
Wed Aug 25 18:27:41 CEST 2010


Here is a patch to allows nix-env -S to actually switch profiles.  Before 
the patch switch profiles relinks the ~/.nix-profile directory, but 
because the ~/.nix-profile directory wasn't in the path, this switch 
didn't really do much.

The patch makes me a little nervous because the path is set to 
~/.nix-profile, but the directory isn't created until later in 
/etc/profile.  Still, I think it is an improvement.

Index: modules/programs/bash/bashrc.sh
===================================================================
--- modules/programs/bash/bashrc.sh     (revision 23377)
+++ modules/programs/bash/bashrc.sh     (working copy)
@@ -15,7 +15,7 @@
  # Include the various profiles in the appropriate environment variables.
  NIX_USER_PROFILE_DIR=/nix/var/nix/profiles/per-user/$USER

-NIX_PROFILES="/var/run/current-system/sw /nix/var/nix/profiles/default 
$NIX_USER_PROFILE_DIR/profile"
+NIX_PROFILES="/var/run/current-system/sw /nix/var/nix/profiles/default 
$HOME/.nix-profile"

  unset PATH INFOPATH PKG_CONFIG_PATH PERL5LIB GST_PLUGIN_PATH KDEDIRS
  unset XDG_CONFIG_DIRS XDG_DATA_DIRS
@@ -43,7 +43,7 @@


  # Search directory for Aspell dictionaries.
-export ASPELL_CONF="dict-dir $NIX_USER_PROFILE_DIR/profile/lib/aspell"
+export ASPELL_CONF="dict-dir $HOME/.nix-profile/lib/aspell"


  # ~/bin and the setuid wrappers override other bin directories.



-- 
Russell O'Connor                                      <http://r6.ca/>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''



More information about the nix-dev mailing list