Nixos-shell: Difference between revisions
imported>Onny mNo edit summary |
imported>Mic92 fix typo |
||
| Line 11: | Line 11: | ||
== Usage == | == Usage == | ||
Create a | Create a single example file containing the system configuration for the virtual machine | ||
{{file|myvm.nix|nix|<nowiki> | {{file|myvm.nix|nix|<nowiki> | ||
{ pkgs, ... }: { | { pkgs, ... }: { | ||
services.dokuwiki.sites."localhost" = { | services.dokuwiki.sites."localhost" = { | ||
enable = true; | enable = true; | ||
| Line 22: | Line 23: | ||
</nowiki>}} | </nowiki>}} | ||
In this example, we'll have a virtual guest machine running an instance of [[ | In this example, we'll have a virtual guest machine running an instance of [[DokuWiki]] on port <code>80</code>. Start the VM while forwarding port <code>8080</code> on the host to port <code>80</code> on the guest | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| Line 28: | Line 29: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
After the VM is successfully booted, | After the VM is successfully booted, DokuWiki will be available on http://localhost:8080 | ||