My understanding is like this. For multi-user computers, you’d manage packages with home manager. If you’re developing a project or need some kind of specific built tool or dependency, define in it in a flake.nix or shell.nix or build.nix in the project folder. And for single user computers, or maybe admin accounts install at NixOS configuration.

Whats the intent for each location? The current question Im asking myself is “why install home manager when Im on a single user instance and can just update configuration.nix?”

  • @yiliu@informis.land
    link
    fedilink
    English
    31 year ago

    If you’re just handling one single-user computer, just use configuration.nix. Also, stuff related to admin, system maintenance, or anything host-specific goes here.

    As you say, if you want a portable config you can use on many computers for yourself, home-manager is your friend. I use it for all my systems, NixOS and otherwise.

    I only use nix shell if I need something once, or at least rarely. It’s for one-offs.

    If I’m writing or packaging something I’ll use a flake…but if I want it installed on my systems I’ll import & use the flake in either my system or home-manager config. Define a package and an overlay, at which point it’s just a regular package.