1# Usage:
2# $ NIX_PATH=`pwd`:nixos-config=`pwd`/nixpkgs/nixos/modules/virtualisation/cloud-image.nix nix-build '<nixpkgs/nixos>' -A config.system.build.cloudImage
3
4{ config, lib, pkgs, ... }:
5
6with lib;
7
8{
9 system.build.cloudImage = import ../../lib/make-disk-image.nix {
10 inherit pkgs lib config;
11 partitioned = true;
12 diskSize = 1 * 1024;
13 configFile = pkgs.writeText "configuration.nix"
14 ''
15 { config, lib, pkgs, ... }:
16
17 with lib;
18
19 {
20 imports = [ <nixpkgs/nixos/modules/virtualisation/cloud-image.nix> ];
21 }
22 '';
23 };
24
25 imports = [ ../profiles/qemu-guest.nix ];
26
27 fileSystems."/".device = "/dev/disk/by-label/nixos";
28
29 boot = {
30 kernelParams = [ "console=ttyS0" ];
31 loader.grub.device = "/dev/vda";
32 loader.timeout = 0;
33 };
34
35 networking.hostName = mkDefault "";
36
37 services.openssh = {
38 enable = true;
39 permitRootLogin = "without-password";
40 passwordAuthentication = mkDefault false;
41 };
42
43 services.cloud-init.enable = true;
44}