NixOS
Site Home
NixOS
Nix
Nixpkgs
About
Download
Learn
Packages
Options
Community
Governance
Donate
Nix Pills
Version 20200322091958-ab70c4d
Preface →
Preface
1. Why You Should Give it a Try
1.1. Introduction
1.2. Rationale for this series
1.3. Not being purely functional
1.4. Being purely functional
1.5. Mutable vs. immutable
1.6. Conclusion
1.7. Next pill...
2. Install on Your Running System
2.1. Installation
2.2. The beginnings of the Nix store
2.3. The Nix database
2.4. The first profile
2.5. Nixpkgs expressions
2.6. FAQ: Can I change /nix to something else?
2.7. Conclusion
2.8. Next pill...
3. Enter the Environment
3.1. Enter the environment
3.2. Install something
3.3. Path merging
3.4. Rolling back and switching generation
3.5. Querying the store
3.6. Closures
3.7. Dependency resolution
3.8. Recovering the hard way
3.9. Channels
3.10. Conclusion
3.11. Next pill
4. The Basics of the Language
4.1. Value types
4.2. Identifier
4.3. Strings
4.4. Lists
4.5. Attribute sets
4.6. If expressions
4.7. Let expressions
4.8. With expression
4.9. Laziness
4.10. Next pill
5. Functions and Imports
5.1. Nameless and single parameter
5.2. More than one parameter
5.3. Arguments set
5.4. Default and variadic attributes
5.5. Imports
5.6. Next pill
6. Our First Derivation
6.1. The derivation function
6.2. Digression about .drv files
6.3. What's in a derivation set
6.4. Referring to other derivations
6.5. An almost working derivation
6.6. When is the derivation built
6.7. Conclusion
6.8. Next pill
7. Working Derivation
7.1. Introduction
7.2. Using a script as a builder
7.3. The builder environment
7.4. The .drv contents
7.5. Packaging a simple C program
7.6. Explanation
7.7. Enough of
nix repl
7.8. Next pill
8. Generic Builders
8.1. Packaging GNU hello world
8.2. A generic builder
8.3. A more convenient derivation function
8.4. Conclusion
8.5. Next pill
9. Automatic Runtime Dependencies
9.1. Build dependencies
9.2. Digression about NAR files
9.3. Runtime dependencies
9.4. Another phase in the builder
9.5. Conclusion
9.6. Next pill
10. Developing with
nix-shell
10.1. What's nix-shell
10.2. A builder for nix-shell
10.3. Conclusion
10.4. Next pill
11. Garbage Collector
11.1. How does it work
11.2. Playing with the GC
11.3. Indirect roots
11.4. Cleanup everything
11.5. Conclusion
11.6. Next pill
12. Inputs Design Pattern
12.1. Repositories in Nix
12.2. The single repository pattern
12.3. Packaging graphviz
12.4. Digression about gcc and ld wrappers
12.5. Completing graphviz with gd
12.6. The repository expression
12.7. The inputs pattern
12.8. Conclusion
12.9. Next pill
13. Callpackage Design Pattern
13.1. The callPackage convenience
13.2. Implementing callPackage
13.3. Use callPackage to simplify the repository
13.4. Conclusion
13.5. Next pill
14. Override Design Pattern
14.1. About composability
14.2. The override pattern
14.3. The override implementation
14.4. Conclusion
14.5. Next pill
15. Nix Search Paths
15.1. The NIX_PATH
15.2. Fake it a little
15.3. The path to repository
15.4. A big word about nix-env
15.5. Conclusion
15.6. Next pill
16. Nixpkgs Parameters
16.1. The default.nix expression
16.2. The system parameter
16.3. The config parameter
16.4. About .nix functions
16.5. Conclusion
16.6. Next pill
17. Nixpkgs Overriding Packages
17.1. Overriding a package
17.2. In an imperative world...
17.3. Fixed point
17.3.1. Overriding a set with fixed point
17.4. Overriding nixpkgs packages
17.5. The ~/.nixpkgs/config.nix file
17.6. Conclusion
17.7. Next pill
18. Nix Store Paths
18.1. Source paths
18.1.1. Step 1, compute the hash of the file
18.1.2. Step 2, build the string description
18.1.3. Step 3, compute the final hash
18.2. Output paths
18.3. Fixed-output paths
18.4. Conclusion
18.5. Next pill
19. Fundamentals of Stdenv
19.1. What is stdenv
19.2. The setup file
19.3. How is the setup file built
19.4. The stdenv.mkDerivation builder
19.5. Conclusion
19.6. Next pill...
20. Basic Dependencies and Hooks
20.1. The
buildInputs
Attribute
20.2. The
propagatedBuildInputs
Attribute
20.3. Setup Hooks
20.4. Environment Hooks
20.5. Next pill...
Preface →