We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99d2d08 commit 00bb7c0Copy full SHA for 00bb7c0
docs/document/Skill/Nix/docs/1.Language/Modules.md
@@ -0,0 +1,29 @@
1
+# Modules
2
+
3
+Generally any nix file is a module, contains either a function or a attribute set.
4
5
+## Module Identifier
6
7
+- relative path to a nix file
8
+- keys in `NIX_PATH`: any key in `NIX_PATH` is a valid identifier of nix module.
9
+```sh
10
+$ echo $NIX_PATH
11
12
+nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
13
+```
14
15
+```nix
16
+{
17
+ import = [
18
+ <nixpkgs> # [!code highlight]
19
+ ];
20
+}
21
22
+# or
23
24
+let
25
+ pkgs = import <nixpkgs>; # [!code highlight]
26
+in {
27
28
29
0 commit comments