depot/nix/pkgs/factorio-mods/default.nix

22 lines
647 B
Nix
Raw Permalink Normal View History

{ 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;
}