1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2025-01-05 19:03:21 +03:00

doc: Make outputs list configurable

This commit is contained in:
Samuel Dionne-Riel 2022-10-13 23:00:43 -04:00
parent 4c8610afe0
commit 3d069720f5
2 changed files with 21 additions and 3 deletions

View File

@ -5,11 +5,11 @@ def githubURL(device)
"https://github.com/NixOS/mobile-nixos/tree/master/devices/#{device}"
end
def hydraURL(device)
def hydraURL(job)
# Yes, x86_64-linux is by design.
# We're using the pre-built images, cross-compiled.
# If we used the native arch, we'd be in trouble with armv7l.
"https://hydra.nixos.org/job/mobile-nixos/unstable/device.#{device}.x86_64-linux"
"https://hydra.nixos.org/job/mobile-nixos/unstable/#{job}"
end
def yesno(bool)
@ -103,7 +103,15 @@ $devicesInfo.values.each do |info|
Architecture:: #{info["system"]["system"]}
Supports Stage-0:: #{yesno(info["quirks"]["supportsStage-0"])}
Source:: link:#{githubURL(identifier)}[Mobile NixOS repository]
Builds:: link:#{hydraURL(identifier)}[Hydra (`default` build)]
Builds::
#{
info["documentation"]["hydraOutputs"].map do |pair|
output, name = pair
"* link:#{hydraURL(output.gsub("@device@",identifier))}[#{name}]"
end.join("\n")
}
****
EOF

View File

@ -12,9 +12,19 @@ in
default = ./system-types + "/${config.mobile.system.type}/device-notes.adoc.erb";
internal = true;
};
hydraOutputs = mkOption {
type = with types; (listOf (listOf str));
description = "@device@ will be replaced with the device identifer.";
internal = true;
};
};
};
config = {
documentation.nixos.options.splitBuild = false;
mobile.documentation.hydraOutputs = lib.mkAfter [
# x86_64-linux since we link to the cross-compiled build.
# TODO: link to native builds?
["device.@device@.x86_64-linux" "`default` output status"]
];
};
}