Can you please give me some feedback on my initial configuration.nix?

I am really new at nixos although I have used Linux since '98 this is interesting but quiet different approach. What I try to do with nixos it have a configuration.nix file on which I can recover from a crash really fast.

So, I just started and now I feel like I am at a point to ash you guys, the community here, what do you think? Am I heading the right way? Am I doing things stupid which should be done differently? Do you have tips and trick to continue? Where should I go from here? Maybe books you recommend to read on nixos? General commends and advise?

Thanks this will really help me.

My GitHub page configuration.nix

One thing that tripped me and may trip you as well: installing steam as a package won’t work, you want programs.steam.enable = true instead.

https://nixos.wiki/wiki/Steam

1 Like

like this right?
programs.steam.enable = true;

Don’t use users.users..initialPassword. Use users.mutableUsers, and set your user password at installation time. initialPassword is not much better than setting no password at all, have a look at its description.

If you really want to set the password declaratively, use users.users..passwordFile, and supply that password using something like sops-nix or agenix. See also this wiki page. But this may be something to look at once you’ve gotten a bit more used to NixOS :slight_smile:

The caveat from @korfuri is true for docker too, by the way: virtualisation.docker.enable

It’s usually worth looking in the options for the packages you’re installing; NixOS is sufficiently non-ubuntu that just having the files installed isn’t always enough.

2 Likes

Like this?

users.mutableUsers.henry = {
    isNormalUser = true;
    description = "henry";
    extraGroups = [ "networkmanager" "wheel" "video" "audio" "lp" "scanner" ];
    initialPassword = "password";
  };

Like this:

  users = {
    mutableUsers = true;
    users.henry = {
      isNormalUser = true;
      description = "henry";
      extraGroups = [ "networkmanager" "wheel" "video" "audio" "lp" "scanner" ];
      # You can keep the initialPassword if you *really* want to, but
      # that risks forgetting to change it
      # initialPassword = "password";
    };
  };

And then when you install, just remember to run passwd henry and set your password before you reboot.

2 Likes