I don’t know what am I doing wrong here ? when I try to add programs.steam.enable = true;, the compiler say me that the option don’t exists, but it work for programs.home-manager.enable = true; ?
I don’t really know what’s wrong here, if someone can explain it would be kind there is my nix config for context.
there is the error :
error:
… while evaluating a branch condition
at /nix/store/dk2rpyb6ndvfbf19bkb2plcz5y3k8i5v-source/lib/lists.nix:125:9:
124| fold' = n:
125| if n == len
| ^
126| then nul
… while calling the 'length' builtin
at /nix/store/dk2rpyb6ndvfbf19bkb2plcz5y3k8i5v-source/lib/lists.nix:123:13:
122| let
123| len = length list;
| ^
124| fold' = n:
(stack trace truncated; use '--show-trace' to show the full trace)
error: The option `programs.steam' does not exist. Definition values:
- In `/nix/store/yjp62hrl0pbcliiz0skpz01csnm0xkg3-source/home/default.nix':
{
enable = {
_type = "if";
condition = true;
content = true;
...
PS: I’m really new, it’s been only one week since I started using NixOS, so if there is anything I’m doing wrong don’t hesitate to tell me
Home Manager’s options are documented here; it’s a different list from NixOS’s options. They use the same option system but the two projects each have their own set of option definitions. There’s no programs.steam in Home Manager.
Enabling Steam system-wide in NixOS optionally does some system configuration that Home Manager doesn’t have the privileges to do, like opening some firewall ports and configuring some OpenGL stuff. I don’t use Steam but you should be able to simply add pkgs.steam to Home Manager’s home.packages if you’re willing to handle any needed system configuration manually (you might not have to).
You need to put programs.steam.enable = true; in your configuration.nix file, not in home.nix. That will install steam system-wide rather than as a specific user.
It’s also the one way I’ve personally found Steam to run without any issues.
So I installed steam system-wide instead, it seems installed but I can’t run it ?
$ steam
The program 'steam' is not in your PATH. You can make it available in an
ephemeral shell by typing:
nix-shell -p steamPackages.steam-fhsenv-without-steam
any idea why ? (btw I want to avoid as much as possible nix-shell for reproducibility)
What do you mean by “installed steam system-wide”? Did you put programs.steam.enable = true; in your system configuration, and then run sudo nixos-rebuild switch?
Hey, if you are enabling steam through Homemanager and want to access the global configuration, you will need to use osConfig and not config, as the latter is the home-manager configuration.
But if in the global context (outside of HM) using config is correct