1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-04 16:11:06 +01:00
This commit is contained in:
khaneliman 2025-06-24 01:58:06 +00:00
parent 1a71d9e363
commit b4b3b1a3c0

View file

@ -773,7 +773,7 @@ programs.home-manager.path = "$HOME/devel/home-manager";
</code></pre><p>and running <code class="literal">home-manager switch</code> to activate the change.
Afterwards, <code class="literal">home-manager build</code> and <code class="literal">home-manager switch</code> will use
your cloned repository.</p></li></ol></div><p>The first option is good if you only temporarily want to use your clone.</p>
</div><div class="section"> <div class="titlepage"> <div> <div> <h2 id="sec-guidelines" class="title" style="clear: both">Guidelines </h2> </div> </div></div><div class="toc"> <dl class="toc"> <dt> <span class="section"> <a href="index.xhtml#sec-guidelines-back-compat">Maintain backward compatibility</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-forward-compat">Keep forward compatibility in mind</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-valuable-options">Add only valuable options</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-add-tests">Add relevant tests</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-module-maintainer">Add relevant documentation</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#_add_yourself_as_a_module_maintainer">Add yourself as a module maintainer</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-code-style">Format your code</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-commit-message-style">Format your commit messages</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-news-style">Format your news entries</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-conditional-modules">Use conditional modules and news</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-licensing">Mind the license</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-commit-style">Commits</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#ex-commit-message">Example commit</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-code-style">Code Style</a> </span></dt> </dl></div><p>If your contribution satisfy the following rules then there is a good
</div><div class="section"> <div class="titlepage"> <div> <div> <h2 id="sec-guidelines" class="title" style="clear: both">Guidelines </h2> </div> </div></div><div class="toc"> <dl class="toc"> <dt> <span class="section"> <a href="index.xhtml#sec-guidelines-back-compat">Maintain backward compatibility</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-forward-compat">Keep forward compatibility in mind</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-valuable-options">Add only valuable options</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-add-tests">Add relevant tests</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-module-maintainer">Add relevant documentation</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-module-auto-importing">Module Auto-importing</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#_add_yourself_as_a_module_maintainer">Add yourself as a module maintainer</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-code-style">Format your code</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-commit-message-style">Format your commit messages</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-news-style">Format your news entries</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-conditional-modules">Use conditional modules and news</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-guidelines-licensing">Mind the license</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-commit-style">Commits</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#ex-commit-message">Example commit</a> </span></dt><dt> <span class="section"> <a href="index.xhtml#sec-code-style">Code Style</a> </span></dt> </dl></div><p>If your contribution satisfy the following rules then there is a good
chance it will be merged without too much trouble. The rules are
enforced by the Home Manager maintainers and to a lesser extent the Home
Manager CI system.</p><p>If you are uncertain how these rules affect the change you would like to
@ -822,6 +822,22 @@ $ xdg-open ./result/share/doc/home-manager/index.xhtml
the man page version of the module options looks good:</p><pre><code class="programlisting shell">$ nix-build -A docs.manPages
$ man ./result/share/man/man5/home-configuration.nix.5.gz
</code></pre>
</div><div class="section"> <div class="titlepage"> <div> <div> <h3 id="sec-module-auto-importing" class="title" >Module Auto-importing </h3> </div> </div></div><p>Home Manager automatically imports all modules from the <code class="literal">modules/programs/</code> and
<code class="literal">modules/services/</code> directories. This auto-importing behavior follows these
rules:</p><div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: disc;"><li class="listitem"><p><span class="strong"><strong>Nix files</strong></span>: All <code class="literal">.nix</code> files in these directories are automatically
imported</p></li><li class="listitem"><p><span class="strong"><strong>Directories</strong></span>: All subdirectories are automatically imported (typically
containing a <code class="literal">default.nix</code> file)</p></li><li class="listitem"><p><span class="strong"><strong>Exclusions</strong></span>: Files and directories starting with an underscore (<code class="literal">_</code>) are
excluded from auto-importing</p></li></ul></div><p>This allows for flexible module organization:</p><pre><code class="programlisting">modules/programs/
├── git.nix # Single-file module (imported)
├── firefox/ # Multi-file module (imported)
│ ├── default.nix
│ └── addons.nix
├── _experimental.nix # Excluded (starts with _)
└── _wip/ # Excluded directory (starts with _)
└── newfeature.nix
</code></pre><p>When adding a new module, simply place it in the appropriate directory
(<code class="literal">programs/</code> for user programs, <code class="literal">services/</code> for user services) and it will be
automatically discovered and included in the Home Manager module system.</p>
</div><div class="section"> <div class="titlepage"> <div> <div> <h3 id="_add_yourself_as_a_module_maintainer" class="title" >Add yourself as a module maintainer </h3> </div> </div></div><p>Every new module <span class="emphasis"><em>must</em></span> include a named maintainer using the
<code class="literal">meta.maintainers</code> attribute. If you are a user of a module that
currently lacks a maintainer then please consider adopting it.</p><p>If you are present in the nixpkgs maintainer list then you can use that