<inquisitiv3>
I'm trying to install home-manager on my Fedora system with Nix. Step 2 make me a little unsure on what I should do. I've run the `nix-channel` commands, and home-manager shows up when I run `nix-channel --list`. But should I change the $NIX_PATH? The wording in the instructions make it sound that it isn't everytime you need to do that on a system with just Nix.
<inquisitiv3>
And if I need to do that, should I change the .bashrc or my fish shell config? The linked issue is a little over my head.
<inquisitiv3>
I installed fish using `nix-env` and automatically start it every time by having my terminal emulator run `fish` at startup automatically.
<rycee>
inquisitiv3: If `nix-shell '<home-manager>' -A install` works then you don't need to edit NIX_PATH.
<rycee>
You can also run `echo $NIX_PATH` in a shell to see if ~/.nix-defexpr/channels is in there.
<rycee>
And if you are initially starting bash then it is most convenient to edit .bashrc.
<rycee>
Or, rather, ~/.profile
<rycee>
I'm not exactly certain which file to use under Fedora. It should be the one sourced for a login shell :-)
<inquisitiv3>
rycee: Thanks! `nix-shell '<home-manager>' -A install` gives me an error and `echo $NIX_PATH` gives me "nixpkgs=/home/user/.nix-defexpr/channels/nixpkgs". Seems like I've to add it then.
<rycee>
Yeah, I'm not certain why it is that way for standalone Nix installs. Hopefully it will be changed at some point so that it won't be necessary to change NIX_PATH to support alternative channels.
inquisitiv3 has quit [Quit: Leaving]
inquisitiv3 has joined #home-manager
<inquisitiv3>
rycee: Thakns for the help! After adding the path to $NIX_PATH to ~/.bash_profile, logging out and logging in I'm able to create the first home-manager gen! :D
<rycee>
Awesome :-) Don't forget to add `. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"` as well. It is necessary to load the environment variables generated by Home Manager.
<inquisitiv3>
No, I'll follow the instructions from beginning to end.
<inquisitiv3>
But thanks for the reminder!
inquisitiv3 has quit [Quit: Leaving]
inquisitiv3 has joined #home-manager
<inquisitiv3>
rycee: Did everything source correctly if `echo $__HM_SESS_VARS_SOURCED` return 1?
<rycee>
Yeah, that is right :-)
<inquisitiv3>
:D
<rycee>
So if you add, for example, `home.sessionVariables = { FOO = "bar"; }` to your configuration then it will show up in the environment after `home-manager switch` and a relog.
<rycee>
Some of the modules rely on this functionality to work so that's why it's pretty important.
<inquisitiv3>
Thanks for the explaination.
<inquisitiv3>
Is there any reason to manually edit the .config/nixpkgs/home.nix file? Thinking of excluding the file from my dotfiles (whole .config/nixpkgs dir)
<rycee>
I typically set up .config/nixpkgs/home.nix to be a symlink into my git-managed dir of configurations.
<rycee>
It is best not to have HM manage the .config/nixpkgs/home.nix file since you then have to run `home-manager switch` twice for any edits to take effect.
<rycee>
You can also use the -f option with something like `home-manager -f ~/my-confs/hm-config.nix switch`
<inquisitiv3>
When I'll be the file in my dotfiles' repo.
<inquisitiv3>
How do you manage .config/nixpkgs/home.nix with HM directly? I probably missinterpret you.
<rycee>
I don't manage .config/nixpkgs/home.nix at all. It is just a regular symbolic link that I created once. Like `ln -s ~/devel/nixos-config/user/beta.nix .config/nixpkgs/home.nix`.
<rycee>
I have the same for the system configuration `ln -s ~/devel/nixos-config/system/beta.nix /etc/nixos/configuration.nix`.
<inquisitiv3>
Aah, then I missinterpreted what you wrote. Thanks for all the help!
<rycee>
pie___: Yeah, I'll expand that a bit in a while when I get on my computer. Thanks for the suggestion, it'll definitely make it clearer 😃
<rycee>
pie___: Added a bit more to the contact section :-)
thomashoneyman has joined #home-manager
<thomashoneyman>
hey folks! i'm trying to figure out how to set up autorandr so i can connect an external monitor (and turn off my laptop screen when connected)
<thomashoneyman>
anyone know of a home.nix config using this?
<rycee>
You mean using the `programs.autorandr` options?
<thomashoneyman>
hmm there might be a weird interaction with xrandr
<thomashoneyman>
in that i've changed xrandr settings while the machine's been running
<thomashoneyman>
i was just reading that as well
<thomashoneyman>
thanks!
<rycee>
Well, I have to go to bed. Good luck! I'm not sure I can help very much anyway, my use of autorandr is pretty much limited to running `autorandr --change --default horizontal` and accepting whatever happens :-)
<thomashoneyman>
haha
<thomashoneyman>
understood! i just learned about autorandr about twenty minutes ago