I havent used nixos much but I dont understand why people use home manager instead of just the configuration.nix.

Is the only reason using it to not have system wide package installed? Does it have other usecases too?

  • ImgurRefugee114@reddthat.com
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 day ago

    Modules that enable dotfile configuration / management. I only use my system configuration for services and host-wide packages. I keep all my normal user programs in home-manager. My flake lets me easily switch each host between using the home-manager nixos module, or using standalone for rebuilding home independent of the system (without sudo). I have very elaborate librewolf and mpv configurations. The latter I actually switched off of home-manager’s mpv module; now I use a wrapper that packages mpv with my config for it, output as a consumable package. That works for some things, but customizing Firefox/librewolf without the module would be a pain in the ass. It also means I can use my home configurations on non-nixos distros (tho, I haven’t had the need)

  • kybean@pawb.social
    link
    fedilink
    English
    arrow-up
    6
    ·
    2 days ago

    I don’t have to use sudo (and thus type in my password) when I want to install programs/modify app configs when I use home-manager bc it’s per-user. The system config modifies the entire system even if the only changes affect a single user, so will always require using sudo to make the changes

  • juipeltje@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 day ago

    I usually install as much as reasonably possible on the user level because it’s more portable. I mostly use it for installing packages though, i don’t manage my dotfiles with it because i have things like theme switching scripts that rely on editing the symlinked files, and home manager symlinks from the nix store which is read-only. I just have a simple bash script that does the symlinking.

  • [object Object]@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    5
    ·
    2 days ago

    You can use it in other Linux distros that has nix package support. Also user level isolation, and you know stuff you’re installing aren’t going to change something deep in the system.

  • kuerbiskernoel@feddit.org
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 day ago

    Home manager also has a module for most popular software so you can directly configure them in nix, like

    programs.yazi = { enable = true;

    config = { Some stuff };

    Also stuff like enablefishintegration = true; };

    Often more convenient than writing dotfiles and referring to them.

  • Nibodhika@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    2 days ago

    My work laptop is Ubuntu, I can’t change the OS but I can have the exact same user packages and config across all of my systems with it.

  • nous@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 days ago

    It does things the system nix cannot: manage your users config. I use it instead of a dotfile manager as it combines that with being able to install packages.

  • SavvyWolf@pawb.social
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 days ago

    My main PC uses Mint instead of NixOS. Likewise, when I was working those PCs used Mint/Ubuntu. It’s nice being able to have my config on those systems.