rycee changed the topic of #home-manager to: Support and discussion around the Home Manager project (https://github.com/rycee/home-manager) | Logs: https://logs.nix.samueldr.com/home-manager
<Junxuan> hey all, kinda new to nix and home-manager and trying to wrap my head around everything. when i search for packages on the nix website, i see packages that are found within haskellPackages or nodePackages. But I can't seem to find these packages when I search with nix-env -qa
<Junxuan> so how should i go about adding these packages into my home.nix
tdeo has joined #home-manager
<rycee> Junxuan: `home.packages = [ pkgs.haskellPackages.foo ]` should work.
<Junxuan> rycee: ah i see, thank you!
<Junxuan> hi, any idea why this line: imports = if pkgs.stdenv.isDarwin then [./mac.nix]; causes an infinite recursion error?
<Junxuan> I am trying to include packages only when the system is a mac
<Junxuan> i forgot to include the "else" portion above, but i included it in my config
ardumont has quit [Ping timeout: 245 seconds]
ardumont has joined #home-manager
<infinisil> Junxuan: You can't make imports depend on a config/pkgs value
<infinisil> Because config/pkgs gets influenced by the imports
<infinisil> Junxuan: Instead you should always include the file, and condition the config like `mkIf pkgs.stdenv.isDarwin { <darwin settings here> }`
<Junxuan> infinisil: that makes more sense now, so if im trying to only install certain packages on darwin, do i just add an additional home.packages = xxx inside the block?
<infinisil> Yeah, mkIf just declares an attrset that only gets included in the config if the condition is true
<Junxuan> infinisil: sorry to continue to trouble you, my config currently looks like this: https://pastebin.com/GiTwagke
<Junxuan> but im getting syntax errors on line 22 about nix expecting a "." or a "="
<Junxuan> still trying to wrap my head around nix syntax
<infinisil> No problem, you want `home.packages = with pkgs; [ ... ] ++ mkIf stdenv.isDarwin [ ... ];`
<Junxuan> ah it looks so obvious now thank you so much!
<Junxuan> infinisil: just tried this and now im getting value is a set while a list was expected
<Junxuan> this is rather confusing because i dont see any { } at all
<infinisil> Junxuan: ah darn, sorry my mistake
<infinisil> Junxuan: try home.packages = with pkgs; mkMerge [ [ ... ] (mkIf stdenv.isDarwin [ ... ]) ]
<infinisil> I'm pretty sure this should work this time
<Junxuan> just saw this, in the end i solved it with lib.optionals
<Junxuan> not completey sure how it works but it works :D
<infinisil> Junxuan: Oh yeah that works too in this case, nice :)
<Junxuan> any idea if its possible to use home manager to set the default shell? found some stuff that was only specific to nixos. since nix doesnt install stuff to /bin it gets kinda weird adding the nix package to /etc/shells
<infinisil> Junxuan: I remember some people just doing `exec <the shell you want>` in some init file
<Junxuan> infinisil: yeah i guess that works too! thanks for all the help throughout the day!
<rycee> Setting the user shell is a system level configuration, not much that can be done about that in Home Manager. As infinisil mentioned, if you can't set the default shell at the system level then create a `.bashrc` that just execs the shell you want.
ardumont has quit [Ping timeout: 246 seconds]
ardumont has joined #home-manager