|
|
|
@ -98,11 +98,35 @@ let
|
|
|
|
|
in
|
|
|
|
|
builtins.foldl' (images: hostName:
|
|
|
|
|
let
|
|
|
|
|
hostConfig = config.site.hosts.${hostName};
|
|
|
|
|
matches = profiles.identifyProfiles hostConfig.model;
|
|
|
|
|
inherit (config.site.hosts.${hostName}) model;
|
|
|
|
|
matches = profiles.identifyProfiles model;
|
|
|
|
|
fallbackProfile =
|
|
|
|
|
if model == "dir-615-d"
|
|
|
|
|
then (openwrt-imagebuilder.lib.profiles {
|
|
|
|
|
inherit pkgs;
|
|
|
|
|
release = "19.07.10";
|
|
|
|
|
}).identifyProfile model
|
|
|
|
|
else if builtins.match "tl-wr.*" model != null
|
|
|
|
|
then {
|
|
|
|
|
release = "18.06.9";
|
|
|
|
|
packagesArch = "mips_24kc";
|
|
|
|
|
target = "ar71xx";
|
|
|
|
|
variant = "tiny";
|
|
|
|
|
profile = model;
|
|
|
|
|
sha256 = "109a2557gwmgib7r500qn9ygd8j4r4cv5jl5rpn9vczsm4ilkc1z";
|
|
|
|
|
feedsSha256 = {
|
|
|
|
|
base = "0xklqsk6d5d6bai0ry2hzfjr4sycf6241ihv8v1lmmf9r7d47cr1";
|
|
|
|
|
packages = "05g048saibh304ndnlczyq92b1c67c3cqvbhdamw1xqbsp6jzifp";
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
else null;
|
|
|
|
|
in
|
|
|
|
|
if matches == []
|
|
|
|
|
then builtins.trace "${hostName} (${hostConfig.model}) not supported by OpenWRT"
|
|
|
|
|
if matches == [] && fallbackProfile != null
|
|
|
|
|
then images // {
|
|
|
|
|
"${hostName}-image" = build fallbackProfile;
|
|
|
|
|
}
|
|
|
|
|
else if matches == []
|
|
|
|
|
then builtins.trace "${hostName} (${model}) not supported by OpenWRT"
|
|
|
|
|
images
|
|
|
|
|
else if builtins.length matches == 1
|
|
|
|
|
then
|
|
|
|
@ -111,7 +135,7 @@ let
|
|
|
|
|
builtins.elemAt matches 0
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
else builtins.trace "${hostName} (${hostConfig.model}) has multiple models!"
|
|
|
|
|
else builtins.trace "${hostName} (${model}) has multiple models!"
|
|
|
|
|
images // {
|
|
|
|
|
"${hostName}-image" = build (
|
|
|
|
|
builtins.elemAt matches 0
|
|
|
|
|