10 cfg = config.virtualisation.digitalOceanImage;
15 ./digital-ocean-config.nix
16 ./disk-size-option.nix
17 ../image/file-options.nix
18 (lib.mkRenamedOptionModuleWith {
33 virtualisation.digitalOceanImage.configFile = mkOption {
34 type = with types; nullOr path;
37 A path to a configuration file which will be placed at
38 `/etc/nixos/configuration.nix` and be used when switching
39 to a new configuration. If set to `null`, a default
40 configuration is used that imports
41 `(modulesPath + "/virtualisation/digital-ocean-config.nix")`.
45 virtualisation.digitalOceanImage.compressionMethod = mkOption {
53 Disk image compression method. Choose bzip2 to generate smaller images that
54 take longer to generate but will consume less metered storage space on your
55 Digital Ocean account.
66 image.extension = lib.concatStringsSep "." [
73 .${cfg.compressionMethod}
76 system.nixos.tags = [ "digital-ocean" ];
77 system.build.image = config.system.build.digitalOceanImage;
78 system.build.digitalOceanImage = import ../../lib/make-disk-image.nix {
79 name = "digital-ocean-image";
80 inherit (config.image) baseName;
81 inherit (config.virtualisation) diskSize;
92 "gzip" = "${pkgs.gzip}/bin/gzip";
93 "bzip2" = "${pkgs.bzip2}/bin/bzip2";
95 .${cfg.compressionMethod};
98 ${compress} $diskImage
101 if cfg.configFile == null then
102 config.virtualisation.digitalOcean.defaultConfigFile
109 meta.maintainers = with maintainers; [