I’ve been trying nixos recently and after watching a bunch of tutorials from various people, I have managed to enable home-manager and flakes.

My question is: where should I write the packages I want to install? In home.nix? In flakes.nix? In configuration.nix (probably not)? I’m probably only gonna have a single user on this machine.

So far, I think the only difference between writing the packages in home.nix compared to flakes.nix is that in the 1st senario, the apps will only be available for the user, while in the 2nd, it will be available for the whole system. Also, I could use the home.nix for non-nixos systems too. Other than that, I can probably write them the same way either on home.nix or flakes.nix and have the same result on my machine.

PS. On search.nixos.org there is an option to search for flakes. What is this? I am planing to get my packages from the packages tab, but I’m wondering that maybe I should search in the flakes tab instead (though it doesn’t seem to have many packages).

PPS. Those are some resources I’ve found (I’ve mainly watched the videos and have started reading some of the guides):

  • vividspecter@lemm.ee
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 days ago

    System packages in configuration.nix, user packages in home.nix. I’d say anything that is non-interactive and/or requires root access is a good rule of thumb for system packages. Beyond that I try to use modules for configuring packges and there is usually only one of nixos and home manager options (sometimes there are duplicates).

    As for flakes I mostly use it to handle a bunch of different systems from one config and any flake specific configs. I also use standalone flakes for dev environments but that’s not related to the system config.