1# nix-build '<nixpkgs/nixos>' -A config.system.build.openstackImage --arg configuration "{ imports = [ ./nixos/maintainers/scripts/openstack/openstack-image.nix ]; }"
2
3{
4 config,
5 lib,
6 pkgs,
7 ...
8}:
9let
10 copyChannel = true;
11 format = "qcow2";
12in
13{
14 imports = [
15 ../../../modules/virtualisation/openstack-config.nix
16 ../../../modules/image/file-options.nix
17 ] ++ (lib.optional copyChannel ../../../modules/installer/cd-dvd/channel.nix);
18
19 documentation.enable = copyChannel;
20
21 image.extension = format;
22 system.nixos.tags = [ "openstack" ];
23 system.build.image = config.system.build.openstackImage;
24 system.build.openstackImage = import ../../../lib/make-disk-image.nix {
25 inherit
26 lib
27 config
28 copyChannel
29 format
30 ;
31 inherit (config.image) baseName;
32 additionalSpace = "1024M";
33 pkgs = import ../../../.. { inherit (pkgs) system; }; # ensure we use the regular qemu-kvm package
34 configFile = pkgs.writeText "configuration.nix" ''
35 {
36 imports = [ <nixpkgs/nixos/modules/virtualisation/openstack-config.nix> ];
37 }
38 '';
39 };
40
41}