···1+{
2+ lib,
3+ config,
4+ pkgs,
5+ ...
6+}:
7+{
8+ options.image = {
9+ baseName = lib.mkOption {
10+ type = lib.types.str;
11+ default = "nixos-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}";
12+ description = ''
13+ Basename of the image filename without any extension (e.g. `image_1`).
14+ '';
15+ };
16+17+ extension = lib.mkOption {
18+ type = lib.types.str;
19+ description = ''
20+ Extension of the image filename (e.g. `raw`).
21+ '';
22+ };
23+24+ # FIXME: this should be marked readOnly, when there are no
25+ # mkRenamedOptionModuleWith calls with `image.fileName` as
26+ # as a target left anymore (i.e. 24.11). We can't do it
27+ # before, as some source options where writable before.
28+ # Those should use image.baseName and image.extension instead.
29+ fileName = lib.mkOption {
30+ type = lib.types.str;
31+ default = "${config.image.baseName}.${config.image.extension}";
32+ description = ''
33+ Filename of the image including all extensions (e.g `image_1.raw` or
34+ `image_1.raw.zst`).
35+ '';
36+ };
37+38+ filePath = lib.mkOption {
39+ type = lib.types.str;
40+ default = config.image.fileName;
41+ description = ''
42+ Path of the image, relative to `$out` in `system.build.image`.
43+ While it defaults to `config.image.fileName`, it can be different for builders where
44+ the image is in sub directory, such as `iso`, `sd-card` or `kexec` images.
45+ '';
46+ };
47+ };
48+}