Creating a NixOS live CD: Difference between revisions
imported>Makefu mNo edit summary |
imported>Mic92 |
||
| Line 27: | Line 27: | ||
In your iso.nix: | In your iso.nix: | ||
<syntaxhighlight lang="nix"> | |||
# enable ssh in the iso boot process | |||
systemd.services.sshd.wantedBy = lib.mkForce [ "multi-user.target" ]; | |||
users.users.root.openssh.authorizedKeys.keys [ | |||
"ssh-ed25519 AaAeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee username@host" | |||
]; | |||
</syntaxhighlight> | |||
=== Add static ip addresses === | |||
The following snippet is useful, when static ip addresses are required, e.g. for VPS installation | |||
<syntaxhighlight lang="nix"> | |||
networking = { | |||
usePredictableInterfaceNames = false; | |||
interfaces.eth0.ip4 = [{ | |||
address = "64.137.201.46"; | |||
prefixLength = 24; | |||
}]; | |||
defaultGateway = "64.137.201.1"; | |||
nameServers = [ "8.8.8.8" ]; | |||
}; | |||
</syntaxhighlight> | |||
== software installation inside the 'once' deployed and booted image == | == software installation inside the 'once' deployed and booted image == | ||