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 ]
18 ++ (lib.optional copyChannel ../../../modules/installer/cd-dvd/channel.nix);
19
20 documentation.enable = copyChannel;
21
22 image.extension = format;
23 system.nixos.tags = [ "openstack" ];
24 system.build.image = config.system.build.openstackImage;
25 system.build.openstackImage = import ../../../lib/make-disk-image.nix {
26 inherit
27 lib
28 config
29 copyChannel
30 format
31 ;
32 inherit (config.image) baseName;
33 additionalSpace = "1024M";
34 pkgs = import ../../../.. { inherit (pkgs) system; }; # ensure we use the regular qemu-kvm package
35 configFile = pkgs.writeText "configuration.nix" ''
36 {
37 imports = [ <nixpkgs/nixos/modules/virtualisation/openstack-config.nix> ];
38 }
39 '';
40 };
41
42}