Created
August 26, 2019 11:23
-
-
Save clefru/7a44edd81f00ae7d03358ae2c96ebb02 to your computer and use it in GitHub Desktop.
vm-test2.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let pkgs = import <nixpkgs> {}; | |
config = (import <nixpkgs/nixos/lib/eval-config.nix> { | |
system=pkgs.system; | |
modules = [ { | |
fileSystems."/".device = "/dev/disk/by-label/nixos"; | |
boot.loader.grub.version = 2; | |
boot.loader.grub.device = "/dev/sda"; | |
boot.loader.timeout = 0; | |
services.openssh.enable = true; | |
services.openssh.startWhenNeeded = false; | |
services.openssh.extraConfig = "UseDNS no"; | |
} ]; | |
}).config; | |
in | |
import <nixpkgs/nixos/lib/make-disk-image.nix> { | |
name = "libvirtd-ssh-image"; | |
format = "qcow2"; | |
diskSize = 800; | |
config = config; | |
contents = [{ | |
source = (pkgs.writeText "aaaa" "bbb"); | |
target = "/etc/ssh/authorized_keys.d/root"; | |
}]; | |
lib=pkgs.lib; | |
inherit pkgs; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment