Flakes: Difference between revisions
added more to the inputs schema section; newcomers will not look through external documentation for flakes. Tags: Mobile edit Mobile web edit |
Tags: Mobile edit Mobile web edit |
||
| Line 93: | Line 93: | ||
<code>inputs.nixpkgs.url = "nixpkgs/<branch name>";</code> | <code>inputs.nixpkgs.url = "nixpkgs/<branch name>";</code> | ||
For any repository with its own flake.nix file, the website must also be defined. Nix knows where the nixpkgs repository is, so stating that it's on GitHub is unnecessary. | |||
For example, adding [[Hyprland]] as an input would look something like this: | |||
<code>inputs.hyprland.url = "github:hyprwm/Hyprland";</code> | |||
If you want to make Hyprland follow the nixpkgs input to avoid having multiple versions of nixpkgs, this can be done using the following code: | |||
<code>inputs.hyprland.inputs.nixpkgs.follows = "nixpkgs";</code> | |||
Using curly brackets({}), we can shorten all of this and put it in a table. The code will look something like this: | |||
<code>{ | |||
inputs = { | |||
nixpkgs.url = "nixpkgs/<branch name>"; | |||
hyprland = { | |||
url = "github:hyprwm/Hyprland"; | |||
inputs.nixpkgs.follows = "nixpkgs"; | |||
}; | |||
}; | |||
}</code> | |||
=== Output schema === | === Output schema === | ||