[Nix-dev] Garbled man pages/incomplete environment
James Cook
james.cook at utoronto.ca
Sun Jul 5 20:17:10 CEST 2015
What if you leave out the "config.environment.variables //" part (just
environment.variables = { NIX_PATH = "/git/hub/nixcfg"; };)?
The NixOS config infrastructure is supposed to take care of the //
part for you. I think the infinite recursion happens because
config.environment.variables is partly based on the value you define
for environment.variables.
James
On 5 July 2015 at 10:51, Jeffrey David Johnson <jefdaj at gmail.com> wrote:
> Thanks, you're right that was it! I put the mkForce in while trying to
> set NIX_PATH, then forgot to remove it after moving that to
> interactiveShellInit instead. Man pages/environment variables back to
> normal.
>
> That reminds me though, is there a way to force NIX_PATH while leaving
> the rest in place? I tried:
>
> { config, ... }:
> { environment.variables = config.environment.variables // {
> # my other vars here
> NIX_PATH = "/git/hub/nixcfg";
> };
> }
>
> But it causes infinite recursion. I imagine there's a special hook
> or override pattern for that?
> Jeff
>
> On Sat, 4 Jul 2015 18:20:20 -0700
> James Cook <james.cook at utoronto.ca> wrote:
>
>> On 4 July 2015 at 09:24, Jeffrey David Johnson <jefdaj at gmail.com> wrote:
>> > I'm having the same issue described here on the Gentoo forums:
>> >
>> > https://forums.gentoo.org/viewtopic-t-670013.html
>> >
>> > Man pages are hard to read because they're full of control characters. For example:
>> >
>> > NIXOS-REBUILD(8) NixOS Reference Pages NIXOS-REBUILD(8)
>> >
>> > ESC[1mNAMEESC[0m
>> > nixos-rebuild - reconfigure a NixOS machine
>> >
>> > ESC[1mSYNOPSISESC[0m
>> > ESC[1mnixos-rebuild ESC[22m{ESC[1mswitch ESC[22m| ESC[1mboot ESC[22m| ESC[1mtest
>> > ESC[22m| ESC[1mbuild ESC[22m| ESC[1mdry-build ESC[22m| ESC[1mdry-activate ESC[22m|
>> > ...
>> >
>> > I expect it's a problem with my environment variables, so
>> > here's my profile.nix which I import into configuration.nix:
>> >
>> > with import <mypkgs>;
>> >
>> > {
>> > programs.bash = {
>> > enableCompletion = true;
>> > # promptInit = "PS1=\"# \"";
>> > };
>> >
>> > # replaces traditional xinitrc
>> > services.xserver.displayManager.sessionCommands = ''
>> > export EDITOR=qvim # why no gvim?
>> > xsetroot -cursor_name left_ptr &
>> > [[ -a ~/.fehbg ]] && eval $(cat ~/.fehbg)
>> > unclutter -idle 1 &
>> > eval "$(ssh-agent -s)" &
>> > '';
>> >
>> > environment.variables = lib.mkForce rec {
>> > EDITOR = "vim" ;
>> > TERM = TERMINAL;
>> > TERMINAL = "xfce4-terminal";
>> > };
>> >
>> > # this gets reset if in environment.variables for some reason
>> > environment.interactiveShellInit = ''
>> > export NIX_PATH=/git/hub/nixcfg
>> > '';
>> >
>> > # TODO why can't nix-env find things on the regular NIX_PATH?
>> > environment.shellAliases = {
>> > "nix-env" = "nix-env -f ${<mypkgs>}";
>> > };
>> > }
>> >
>> > As you can see I also have issues setting up NIX_PATH.
>> > The current kludgy solution is working OK, but if you know
>> > how to clean it up please mention that too! My worry is
>> > that I've deleted all the environment variables not
>> > mentioned here including some important ones, and man
>> > pages are just the first thing I noticed.
>> >
>> > Thanks
>> > Jeff
>>
>> The only thing that comes to mind: environment.varibles = lib.mkForce
>> ... looks suspicious to me. Does it work without the mkForce?
>>
>> (If environment.variables is like other configuration variables I've
>> met, then mkForce means discard whatever the defaults are, and leaving
>> out mkForce means append the values you specify to whatever the
>> defaults are.)
>>
>> You could always start commenting out parts of the configuration and
>> observing the changes, but of course that's tedious. Maybe using
>> nixos-rebuild build-vm could help.
>>
>> James
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
More information about the nix-dev
mailing list