diff options
author | Jasper Ras <jras@hostnet.nl> | 2024-08-21 16:22:08 +0200 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2024-08-21 16:22:08 +0200 |
commit | f3711a93832df46dc245075df08b9ebfc05266e9 (patch) | |
tree | 167c4c4a9bedd6b94392b20eb6e68bc38656d456 /Buffer/Nix Flakes.md | |
parent | 26b2ee8fe95026e84bd1721910d575db72cc1b3f (diff) |
forgot to commit for a while
Diffstat (limited to 'Buffer/Nix Flakes.md')
-rw-r--r-- | Buffer/Nix Flakes.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Buffer/Nix Flakes.md b/Buffer/Nix Flakes.md new file mode 100644 index 0000000..cb7f69b --- /dev/null +++ b/Buffer/Nix Flakes.md @@ -0,0 +1,21 @@ +#nix + +Nix flakes are source trees containing a file `flake.nix` at their root. The file `flake.nix` provides a standardized way to provide [[Zettelkast/Index/Nix]] artifacts. It's like a package manager for [[Zettelkast/Index/Nix]]. A flake can be dependent on other Flakes and it's possible to pin dependencies to exact revisions by using a `flake.lock` file. + +Nix flake evaluation is hermetic, meaning that it produces the same result wherever it's built.k + +The feature can be enabled in `~/.config/nix/nix.conf`: + +``` +experimental-features = nix-command flakes +``` + +To initialize in a repo: `nix flake init`. + +In flakes dependencies have to be specified explicitly and MUST be locked to specific versions therefore it's no longer allowed to use the nixpkgs found in `NIX_PATH` by referencing it like `<nixpkgs>`. + +Output of a Flake is an arbitrary [[Zettelkast/Index/Nix]] value such as a package, [[NixOS]] module or library function. +Commands `nix build` and `nix shell` will build the output `packages.<system>.default` unless we specify another output, for example: `nix shell .#checks.aarch64-linux.build`. + +--- +[Flakes Wiki](https://nixos.wiki/wiki/Flakes)
\ No newline at end of file |