Skip to content

Commit 62b655c

Browse files
committed
document flake support
1 parent 21fc93a commit 62b655c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,27 @@ Instead of `vm.nix`, `nixos-shell` also accepts other modules on the command lin
3131
$ nixos-shell some-nix-module.nix
3232
```
3333

34+
You can also start a vm from a flake's `nixosConfigurations` using the `--flake` flag.
35+
36+
```console
37+
$ nixos-shell --flake github:Mic92/nixos-shell#vm-forward
38+
```
39+
40+
This will run the `vm-forward` example.
41+
42+
> Note: system configurations have to be made overridable with `lib.makeOverridable` to use them with `nixos-shell`
43+
>```nix
44+
>{
45+
> nixosConfigurations = let
46+
> lib = nixpkgs.lib;
47+
> in {
48+
> vm = lib.makeOverridable lib.nixosSystem {
49+
> # ...
50+
> };
51+
> };
52+
>}
53+
>```
54+
3455
## Terminating the virtual machine
3556
3657
Type `Ctrl-a x` to exit the virtual machine.

0 commit comments

Comments
 (0)