21 lines
647 B
Nix
21 lines
647 B
Nix
{ depot, pkgs, ... }:
|
|
|
|
let
|
|
modData = builtins.fromJSON (builtins.readFile ./mods_lock.json);
|
|
modDrv = pkgs.factorio-utils.modDrv { allRecommendedMods = false; allOptionalMods = false; };
|
|
inherit (depot.ops.secrets.factorio) username token;
|
|
|
|
testModData = modData.mods.Krastorio2;
|
|
modData2Drv = d: modDrv rec {
|
|
inherit (d) name;
|
|
src = pkgs.fetchurl {
|
|
name = d.file_name;
|
|
url = "https://mods.factorio.com${d.download_url}?username=${username}&token=${token}";
|
|
inherit (d) sha1;
|
|
};
|
|
};
|
|
allMods = builtins.mapAttrs (_: modData2Drv) modData.mods;
|
|
in
|
|
allMods // {
|
|
_all = builtins.attrValues allMods;
|
|
}
|