Jump to content

Modular Services: Difference between revisions

From Official NixOS Wiki
Added some information to wiki
m fix: references
 
Line 33: Line 33:




== References ==
== Resources ==


<references />
 
{{Cleanup|reason=More information is needed.}}
 
# {{manual|nixos|modular-services|NixOS Modular Services|subsection=modular-services}}
# {{issue | 428084 | Tracking issue}}

Latest revision as of 01:56, 14 July 2026

⚠︎
Warning: Work in progress

Modular Services are a new experimental module system support in Nixpkgs, that aims to expand the module systems (Eg. NixOS, home-manager, nix-darwin, etc) ecosystem with modularity and portability. Modular services is designed to integrate/compose with other modules systems such as NixOS.

Difference between Traditional Module Systems (such as NixOS) vs Modular Services

Modular services are built for composability, re-usability, are not defined in sets of options, portable. Where as traditional modules are the opposite.

How to use

  • System:
  system.services.<name> = {
    # Usage inside of the traditional module system like NixOS...
    imports = [ pkgs.example.services.default ];
    example.allowAll = false;
  };
  • User:
⚠︎
Warning: Not all module systems support this, like for example NixOS.
  system.user.services.<name> = {
    # Usage inside of the traditional module system like NixOS...
    imports = [ pkgs.example.services.default ];
    example.allowAll = false;
  };


Resources

⚟︎
This article or section needs cleanup. More information is needed. Please edit the article, paying special attention to fixing any formatting issues, inconsistencies, grammar, or phrasing. Make sure to consult the Manual of Style for guidance.
  1. 📖︎ NixOS Modular Services
  2. 428084 🚩︎ Tracking issue