1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-14 18:21:41 +03:00

generated-filesystems: system.build -> mobile.outputs

Additionally properly mark `build.rootfs` as deprecated.

But since that output is kind of special, allow a direct reference!
This commit is contained in:
Samuel Dionne-Riel 2021-08-26 23:24:51 -04:00
parent 8a43a1b840
commit 582f218e83

View File

@ -85,10 +85,23 @@ in
Filesystem definitions that will be created at build.
'';
};
mobile.outputs.generatedFilesystems = lib.mkOption {
type = with types; attrsOf package;
internal = true;
description = ''
All generated filesystems from the build.
'';
};
mobile.outputs.rootfs = lib.mkOption {
type = types.package;
description = ''
The rootfs image for the build.
'';
};
};
config = {
system.build.generatedFilesystems = lib.attrsets.mapAttrs (name: {raw, type, id, label, ...} @ attrs:
mobile.outputs.generatedFilesystems = lib.attrsets.mapAttrs (name: {raw, type, id, label, ...} @ attrs:
if raw != null then raw else
filesystemFunctions."${type}" (attrs // {
name = label;
@ -96,7 +109,12 @@ in
})
) config.mobile.generatedFilesystems;
mobile.outputs.rootfs = config.mobile.outputs.generatedFilesystems.rootfs;
# Compatibility alias with the previous path.
system.build.rootfs = config.system.build.generatedFilesystems.rootfs;
system.build.rootfs =
builtins.trace "`system.build.rootfs` is being deprecated. Use `mobile.outputs.rootfs` instead. It will be removed after 2022-05"
config.mobile.outputs.generatedFilesystems.rootfs
;
};
}