Home Manager: Difference between revisions
imported>Symphorien expand a bit, notably clearly say how to use hm to replace nix-env |
imported>Symphorien make it clear that you need hm to manage your shell configuration. |
||
| Line 15: | Line 15: | ||
Your configuration is stored in <code>~/.config/nixpkgs/home.nix</code>. Each time you modify it, rerun <code>home-manager switch</code> for changes to have effect. | Your configuration is stored in <code>~/.config/nixpkgs/home.nix</code>. Each time you modify it, rerun <code>home-manager switch</code> for changes to have effect. | ||
Note that to work correctly, home-manager needs your shell to source <code>~/.nix-profile/etc/profile.d/hm-session-vars.sh</code>. The most convenient way to do so it to have home-manager manage your whole shell configuration, eg <code>programs.bash.enable = true;</code> or <code>programs.zsh.enable = true;</code>. But in this case your whole bashrc is managed with Home Manager: the years of customization you accumulated in your former .bashrc must be migrated to Home Manager options, which may take some time. The quick and dirty way to do the migration is to move your bashrc to some other location and source it from Home Manager: | |||
<syntaxhighlight lang="nix"> | |||
{ pkgs, ...}: { | |||
programs.bash = { | |||
enable = true; | |||
bashrcExtra = '' | |||
. ~/oldbashrc | |||
''; | |||
}; | |||
} | |||
</syntaxhighlight> | |||
=== Usage as a NixOS module === | === Usage as a NixOS module === | ||