mirror of
https://github.com/daylinmorgan/oizys.git
synced 2025-02-22 23:35:51 -06:00
nix commands implicitly load flake.nix
This commit is contained in:
parent
82a55e6732
commit
08748a4850
1 changed files with 16 additions and 0 deletions
16
README.md
16
README.md
|
@ -4,6 +4,22 @@ This shows how to build the same config, with and without flakes.
|
||||||
|
|
||||||
It also shows that `flake.nix` is basically just some syntax.
|
It also shows that `flake.nix` is basically just some syntax.
|
||||||
|
|
||||||
|
## flake fundamentals
|
||||||
|
|
||||||
|
Nix is in flakes mode when:
|
||||||
|
1. `nixos-rebuild <cmd> --flake '.#'` is used
|
||||||
|
2. `nix build '.#something'` the hash-tag syntax is used
|
||||||
|
|
||||||
|
**This automatically loads from a `flake.nix` in the specified dir.**
|
||||||
|
|
||||||
|
If the flake.nix were located elsewhere you could do this too:
|
||||||
|
|
||||||
|
* `nix build '/home/cole/code/nixos-flake-example#something` (loads from `/home/cole/code/nixos-flake-example`)
|
||||||
|
* `nix build 'github.com:colemickens/nixos-flake-example#something` (loads from `flake.nix` in the root of that repo checkout)
|
||||||
|
|
||||||
|
Those are just examples of syntax. Again,
|
||||||
|
|
||||||
|
|
||||||
## overview
|
## overview
|
||||||
|
|
||||||
Note that these produce the same output:
|
Note that these produce the same output:
|
||||||
|
|
Loading…
Add table
Reference in a new issue