diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-08-21 22:09:29 +0200 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-08-21 22:09:29 +0200 |
commit | 27514d58573ce1f844af4ea60afa72c7f58f1cd7 (patch) | |
tree | 4b16c31f73cb72435d03d5e105261143f8ca135f /Nix flakes.md | |
parent | 22675cd8dc75d8b8d4b0f818f5b093efbc364802 (diff) |
Diffstat (limited to 'Nix flakes.md')
-rw-r--r-- | Nix flakes.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Nix flakes.md b/Nix flakes.md new file mode 100644 index 0000000..f57ed36 --- /dev/null +++ b/Nix flakes.md @@ -0,0 +1,24 @@ +--- +tags: + - nix +--- +[[Referencing a nix flake]] + +--- + +Root directory contains flake.nix: +Specifies inputs (other flakes) and outputs ([[Nix derivations]]). Allows pinning versions of inputs (dependencies) making it easier to write reproducable expressions. + +Avoid multiple nixpkgs by including a follows on the input: +``` +inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/<branch name>"; + hyprland = { + url = "github:hyprwm/Hyprland"; + inputs.nixpkgs.follows = "nixpkgs"; + }; +}; +``` + +Outputs: +[Flake check](https://github.com/NixOS/nix/blob/master/src/nix/flake-check.md) |