···11+{
22+ lib,
33+ config,
44+ pkgs,
55+ ...
66+}:
77+{
88+ options.image = {
99+ baseName = lib.mkOption {
1010+ type = lib.types.str;
1111+ default = "nixos-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}";
1212+ description = ''
1313+ Basename of the image filename without any extension (e.g. `image_1`).
1414+ '';
1515+ };
1616+1717+ extension = lib.mkOption {
1818+ type = lib.types.str;
1919+ description = ''
2020+ Extension of the image filename (e.g. `raw`).
2121+ '';
2222+ };
2323+2424+ # FIXME: this should be marked readOnly, when there are no
2525+ # mkRenamedOptionModuleWith calls with `image.fileName` as
2626+ # as a target left anymore (i.e. 24.11). We can't do it
2727+ # before, as some source options where writable before.
2828+ # Those should use image.baseName and image.extension instead.
2929+ fileName = lib.mkOption {
3030+ type = lib.types.str;
3131+ default = "${config.image.baseName}.${config.image.extension}";
3232+ description = ''
3333+ Filename of the image including all extensions (e.g `image_1.raw` or
3434+ `image_1.raw.zst`).
3535+ '';
3636+ };
3737+3838+ filePath = lib.mkOption {
3939+ type = lib.types.str;
4040+ default = config.image.fileName;
4141+ description = ''
4242+ Path of the image, relative to `$out` in `system.build.image`.
4343+ While it defaults to `config.image.fileName`, it can be different for builders where
4444+ the image is in sub directory, such as `iso`, `sd-card` or `kexec` images.
4545+ '';
4646+ };
4747+ };
4848+}