deploy: 6c78ba7932
This commit is contained in:
parent
4e80a54a4e
commit
3249789ee1
|
@ -587,7 +587,7 @@ If you refer to an option then write its full attribute path. That is, instead o
|
|||
</p><pre class="screen">The option 'foo' has been deprecated, please use 'bar' instead.</pre><p class="simpara">it should read</p><pre class="screen">The option 'services.myservice.foo' has been deprecated, please
|
||||
use 'services.myservice.bar' instead.</pre></li><li class="listitem"><p class="simpara">
|
||||
A new module, say <code class="literal">foo.nix</code>, should always include a news entry that has a message along the lines of
|
||||
</p><pre class="screen">A new module is available: 'services.foo'.</pre><p class="simpara">If the module is platform specific, e.g., a service module using systemd, then a condition like</p><pre class="programlisting nix">condition = hostPlatform.isLinux;</pre><p class="simpara">should be added. If you contribute a module then you don’t need to add this entry, the merger will create an entry for you.</p></li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-tests"></a>5.6. Tests</h2></div></div></div><p>Home Manager includes a basic test suite and it is highly recommended to include at least one test when adding a module. Tests are typically in the form of "golden tests" where, for example, a generated configuration file is compared to a known correct file.</p><p>It is relatively easy to create tests by modeling the existing tests, found in the <code class="literal">tests</code> project directory.</p><p>The full Home Manager test suite can be run by executing</p><pre class="programlisting console">$ nix-shell --pure tests -A run.all</pre><p>in the project root. List all test cases through</p><pre class="programlisting console">$ nix-shell --pure tests -A list</pre><p>and run an individual test, for example <code class="literal">alacritty-empty-settings</code>, through</p><pre class="programlisting console">$ nix-shell --pure tests -A run.alacritty-empty-settings</pre><p>However, those invocations will impurely source the system’s nixpkgs, and may cause failures. To run against the nixpkgs from the flake.lock, use instead e.g.</p><pre class="programlisting console">$ nix develop --ignore-environment .#all</pre></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="ch-3rd-party"></a>Chapter 6. Third-Party Tools and Extensions</h1></div></div></div><p>Here is a collection of tools and extensions that relate to Home
|
||||
</p><pre class="screen">A new module is available: 'services.foo'.</pre><p class="simpara">If the module is platform specific, e.g., a service module using systemd, then a condition like</p><pre class="programlisting nix">condition = hostPlatform.isLinux;</pre><p class="simpara">should be added. If you contribute a module then you don’t need to add this entry, the merger will create an entry for you.</p></li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-tests"></a>5.6. Tests</h2></div></div></div><p>Home Manager includes a basic test suite and it is highly recommended to include at least one test when adding a module. Tests are typically in the form of "golden tests" where, for example, a generated configuration file is compared to a known correct file.</p><p>It is relatively easy to create tests by modeling the existing tests, found in the <code class="literal">tests</code> project directory. For a full reference to the functions available in test scripts, you can look at NMT’s <a class="link" href="https://git.sr.ht/~rycee/nmt/tree/master/item/bash-lib" target="_top">bash-lib</a>.</p><p>The full Home Manager test suite can be run by executing</p><pre class="programlisting console">$ nix-shell --pure tests -A run.all</pre><p>in the project root. List all test cases through</p><pre class="programlisting console">$ nix-shell --pure tests -A list</pre><p>and run an individual test, for example <code class="literal">alacritty-empty-settings</code>, through</p><pre class="programlisting console">$ nix-shell --pure tests -A run.alacritty-empty-settings</pre><p>However, those invocations will impurely source the system’s nixpkgs, and may cause failures. To run against the nixpkgs from the flake.lock, use instead e.g.</p><pre class="programlisting console">$ nix develop --ignore-environment .#all</pre></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="ch-3rd-party"></a>Chapter 6. Third-Party Tools and Extensions</h1></div></div></div><p>Here is a collection of tools and extensions that relate to Home
|
||||
Manager. Note, these are maintained outside the regular Home Manager
|
||||
flow so quality and support may vary wildly. If you encounter problems
|
||||
then please raise them in the corresponding project, not as issues in
|
||||
|
|
Loading…
Reference in a new issue