-
-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- move introduction to the overview - use nix-shell and nix-instantiate - be a bit more precise where it seems important - add section headings - add more links - cut redundant parts from the deep dive
- Loading branch information
1 parent
30ea522
commit cfe0f78
Showing
8 changed files
with
92 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ pkgs ? import <nixpkgs> { } }: | ||
let | ||
result = pkgs.lib.evalModules { | ||
modules = [ | ||
./options.nix | ||
./config.nix | ||
]; | ||
}; | ||
in | ||
result.config |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nix-shell -p jq --run "nix-instantiate --eval --json | jq" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,34 @@ | ||
# Module system | ||
|
||
Learn about the module system. | ||
Much of the power in Nixpkgs and NixOS comes from the module system. | ||
|
||
The module system is a Nix language library that enables you to | ||
- Declare one attribute set using many separate Nix expressions. | ||
- Impose dynamic type constraints on values in that attribute set. | ||
- Define values for the same attribute in different Nix expressions and merge these values automatically according to their type. | ||
|
||
These Nix expressions are called modules and must have a particular structure. | ||
|
||
In this tutorial series you'll learn | ||
- What a module is and how to create one. | ||
- What options are and how to declare them. | ||
- How to express dependencies between modules. | ||
|
||
## What do you need? | ||
|
||
- Familiarity with data types and general programming concepts | ||
- A {ref}`Nix installation <install-nix>` to run the examples | ||
- Intermediate proficiency in reading and writing the {ref}`Nix language <reading-nix-language>` | ||
|
||
## How long will it take? | ||
|
||
This is a very long tutorial. | ||
Prepare for at least 3 hours of work. | ||
|
||
```{toctree} | ||
:maxdepth: 1 | ||
:caption: Lessons | ||
:numbered: | ||
a-basic-module/index.md | ||
module-system.md | ||
deep-dive.md | ||
``` |