Jump to content

Cheatsheet: Difference between revisions

232 bytes removed ,  17 August 2020
→‎Building a service as a VM (for testing): systemd-getty-generator with console=ttyS0 starts getty automatically
imported>Patryk27
(Elaborate a bit on the Nix's concept of package versioning)
imported>Flokli
(→‎Building a service as a VM (for testing): systemd-getty-generator with console=ttyS0 starts getty automatically)
Line 406: Line 406:
$ export QEMU_OPTS="-nographic -serial mon:stdio" QEMU_KERNEL_PARAMS=console=ttyS0  
$ export QEMU_OPTS="-nographic -serial mon:stdio" QEMU_KERNEL_PARAMS=console=ttyS0  
$ /nix/store/lshw31yfbb6izs2s594jd89ma4wf8zw6-nixos-vm/bin/run-nixos-vm
$ /nix/store/lshw31yfbb6izs2s594jd89ma4wf8zw6-nixos-vm/bin/run-nixos-vm
</syntaxHighlight>
To be able to log in you will need a getty started on a serial console as well in your nixos configuration:
<syntaxHighlight lang="nix">
{...}: {
  # ..
  systemd.services."serial-getty@ttyS0".enable = true;
}
</syntaxHighlight>
</syntaxHighlight>


Line 430: Line 421:
}
}
</syntaxHighlight>
</syntaxHighlight>
=== Reuse a package as a build environment ===
=== Reuse a package as a build environment ===
As packages already contains all build dependencies, they can be reused to a build environment quickly.
As packages already contains all build dependencies, they can be reused to a build environment quickly.
Anonymous user