Nixos-shell: Difference between revisions

imported>Onny
No edit summary
Onny (talk | contribs)
Add section how to use local nixpkgs folder
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[https://github.com/Mic92/nixos-shell Nixos-shell] is a small helper script for spawning lightweight NixOS virtual machines in a shell.
{{DISPLAYTITLE:{{#if:{{NAMESPACE}}|{{NAMESPACE}}:|}}{{lcfirst:{{PAGENAME}}}}}}
[https://github.com/Mic92/nixos-shell nixos-shell] is a small helper script for spawning lightweight NixOS virtual machines in a shell.


== Installation ==
== Installation ==
Line 20: Line 21:
     settings.title = "My Wiki";
     settings.title = "My Wiki";
   };
   };
};
}
</nowiki>}}
</nowiki>}}


Line 30: Line 31:


After the VM is successfully booted, DokuWiki will be available on http://localhost:8080
After the VM is successfully booted, DokuWiki will be available on http://localhost:8080
=== Reference local nixpkgs folder ===
Using the <code>-I nixpkgs</code> parameter, you could choose to use a local ''nixpkgs'' repository, for example to test unfinished packages or modules:<syntaxhighlight lang="bash">
nixos-shell -I nixpkgs=/home/myuser/projects/nixpkgs myvm.nix
</syntaxhighlight>


=== Mounting host directories ===
=== Mounting host directories ===
Line 87: Line 93:


The configuration of the virtual machine is inside the file <code>myvm.nix</code> in the same directory. The virtual machine will use the nixpkgs source defined in the flake inputs.
The configuration of the virtual machine is inside the file <code>myvm.nix</code> in the same directory. The virtual machine will use the nixpkgs source defined in the flake inputs.
[[Category:Container]]