-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdisko-images.nix
62 lines (59 loc) · 1.84 KB
/
disko-images.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{ self, config, lib, pkgs, modulesPath, specialArgs, ... }:
with lib;
let
origConfig = config;
diskoImages = import ./create-disko-images-in-vm.nix rec {
inherit lib pkgs;
config = origConfig;
size = cfg.defaultDiskAllocSize;
inherit (cfg) compress emulateUEFI includeChannel memory;
};
cfg = config.diskoImages;
in
{
options.diskoImages = {
compress = mkOption {
default = true;
description = lib.mdDoc ''
Compresses qcow2 image as final step when enabled
'';
};
includeChannel = mkOption {
default = true;
description = lib.mdDoc ''
Whether to install nixpkgs.
'';
};
memory = mkOption {
default = 1024;
description = lib.mdDoc ''
How much memory (RAM) in MiB to allocate for VM during build.
Some builds require more memory.
'';
};
defaultDiskAllocSize = mkOption {
default = "2048M";
description = lib.mdDoc ''
Default initial qcow2 image file size allocation (in MB) for each disk in disko.devices.disk.
Use config.diskoImages.diskAllocSizes for specific allocation sizes per disk.
'';
};
diskAllocSizes = mkOption {
default = {};
description = lib.mdDoc ''
Initial qcow2 image file size allocation (in MB) for each disko.devices.disk.xyz. Defaults to config.diskoImages.defaultDiskAllocSize
'';
};
emulateUEFI = mkOption {
default = config.boot.loader.efi.canTouchEfiVariables;
type = types.bool;
defaultText = literalExpression "config.boot.loader.efi.canTouchEfiVariables";
description = lib.mdDoc ''
If true will emulate UEFI for storing EFI variables, e.g. boot entries. Variables will be stored as efidisk.qcow2
'';
};
};
config = {
system.build.diskoPartyImages = diskoImages.images;
};
}