This commit is contained in:
Cole Mickens 2020-10-24 21:37:56 -07:00
parent 7f5a847ae4
commit 72f39dbc31
No known key found for this signature in database
GPG key ID: B475C2955744A019

View file

@ -10,18 +10,21 @@ Nix is in flakes mode when:
1. `nixos-rebuild <cmd> --flake '.#'` is used 1. `nixos-rebuild <cmd> --flake '.#'` is used
2. `nix build '.#something'` the hash-tag syntax is used 2. `nix build '.#something'` the hash-tag syntax is used
**This automatically loads from a `flake.nix` in the specified dir.** **This automatically loads from a `flake.nix` in the specified dir. See these examples:**
If the flake.nix were located elsewhere you could do this too: These three examples, for me, are all the same source, but accessed in different ways:
* `nix build '/home/cole/code/nixos-flake-example#nixosConfigufations` * `nix build '.#nixosConfigurations.mysystem'`
(loads from `/home/cole/code/nixos-flake-example'`) (loads `flake.nix` from `.` (current dir))
* `nix build 'github.com:colemickens/nixos-flake-example#something'`
(loads from `flake.nix` in the root of that repo checkout) * `nix build '/home/cole/code/nixos-flake-example#nixosConfigurations.mysystem'`
Those are just examples of syntax. Again, (loads `flake.nix` from `/home/cole/code/nixos-flake-example`)
* `nix build 'github.com:colemickens/nixos-flake-example#nixosConfigurations.mysystem'`
(nix will clone my github repo, then load `flake.nix` from `flake.nix` in the root of that repo checkout)
## more tips ## more tips