{ config, pkgs, ... }: let modDrv = pkgs.factorio-utils.modDrv { allRecommendedMods = true; allOptionalMods = false; }; modPortalDrv = { id, name, version, sha256, deps ? [], optionalDeps ? [], recommendedDeps ? [] }: modDrv { # src = pkgs.factorio-fetch { # name = ''${name}_${version}.zip''; # url = ''https://mods.factorio.com/api/downloads/data/mods/${id}_${version}.zip''; # inherit sha256; # loginUrl = ""; # }; src = pkgs.fetchurl { url = ''https://f.141.li/${name}_${version}.zip''; inherit name sha256; }; inherit deps optionalDeps recommendedDeps; }; availableMods = rec { autofill = modPortalDrv { id = "354"; name = "autofill"; version = "1.4.5"; sha256 = null; }; EvoGUI = modPortalDrv { id = "160"; name = "EvoGUI"; version = "0.4.108"; sha256 = null; }; factorio-reach = modPortalDrv { id = "100"; name = "factorio-reach"; version = "2.1.1"; sha256 = null; }; FAIR = modPortalDrv { id = "400"; name = "FAIR"; version = "0.0.1"; sha256 = null; }; EvenMoreLight = modPortalDrv { id = "551"; name = "EvenMoreLight"; version = "0.0.3"; sha256 = null; }; RailTanker = modPortalDrv { id = "45"; name = "RailTanker"; version = "1.4.0"; sha256 = null; }; rso-mod = modPortalDrv { id = "34"; name = "rso-mod"; version = "2.2.2"; sha256 = null; }; YARM = modPortalDrv { id = "187"; name = "YARM"; version = "0.7.106"; sha256 = null; }; }; in { services.factorio = { enable = true; saveName = config.networking.hostName; mods = with availableMods; [ autofill EvoGUI factorio-reach FAIR EvenMoreLight RailTanker rso-mod YARM ]; autosave-interval = 10; }; nixpkgs.config.allowUnfree = true; nixpkgs.config.packageOverrides = pkgs: { factorio-mkModDirDrv = pkgs.factorio-utils.mkModDirDrv; }; }