In Home Manager, why use a module instead of a package and config file?

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/NixOS

Our great sponsors
  • SonarLint - Clean code begins in your IDE with SonarLint
  • Mergify - Automate your Pull Request with Mergify
  • Scout APM - Less time debugging, more time building
  • Home Manager using Nix

    Manage a user environment using Nix [[email protected]]

    With Home Manager, I can do the same as I would on Arch, but I can also instead use a module: https://github.com/nix-community/home-manager/blob/master/modules/programs/kitty.nix

  • nixpkgs

    Nix Packages collection

    However, Nix modules are designed to integrate a package with the entire system. For example, in that Kitty home-manager module, it defines xdg.configFile."kitty/kitty.conf", which manages the file ~/.config/kitty/kitty.conf in a declarative way. The Kitty Nix module allows you to manage all of the parts of Kitty scattered around the system (such as its configuration file) in a declarative way, with all of the benefits that declarative and immutable configuration files bring (rollbacks, easy saving in git, easy provisioning on new machines, ...). In this specific case of Kitty, that doesn't sound that helpful. However, for complicated services such as Nextcloud with many options, the Nextcloud NixOS module allows you to easily declaratively specify Nextcloud settings without having to mess with random configuration files.

  • SonarLint

    Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts