Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f2c07cd63ee4
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 24865963f0e7
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Nov 28, 2018

  1. modularity: Document the ability to use non-files in imports (#50503)

    * modularity: Document the ability to use non-files in imports
    * Update nixos/doc/manual/configuration/modularity.xml
    
    Co-Authored-By: Baughn <svein@google.com>
    Baughn authored and markuskowa committed Nov 28, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    DuCanhGH Ngô Đức Anh
    Copy the full SHA
    2486596 View commit details
Showing with 19 additions and 0 deletions.
  1. +19 −0 nixos/doc/manual/configuration/modularity.xml
19 changes: 19 additions & 0 deletions nixos/doc/manual/configuration/modularity.xml
Original file line number Diff line number Diff line change
@@ -127,4 +127,23 @@ nix-repl> map (x: x.hostName) config.<xref linkend="opt-services.httpd.virtualHo
[ "example.org" "example.gov" ]
</screen>
</para>

<para>
While abstracting your configuration, you may find it useful to generate
modules using code, instead of writing files. The example
below would have the same effect as importing a file which sets those
options.
<screen>
{ config, pkgs, ... }:

let netConfig = { hostName }: {
networking.hostName = hostName;
networking.useDHCP = false;
};

in

{ imports = [ (netConfig "nixos.localdomain") ]; }
</screen>
</para>
</section>