nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 113 lines 2.6 kB view raw
1{ 2 lib, 3 stdenv, 4 buildGoModule, 5 fetchFromGitHub, 6 nodejs, 7 pnpm_8, 8 wails, 9 wrapGAppsHook3, 10 glib-networking, 11 makeDesktopItem, 12 copyDesktopItems, 13}: 14 15buildGoModule rec { 16 pname = "satisfactorymodmanager"; 17 version = "3.0.3"; 18 19 src = fetchFromGitHub { 20 owner = "satisfactorymodding"; 21 repo = "SatisfactoryModManager"; 22 tag = "v${version}"; 23 hash = "sha256-ndvrgSRblm7pVwnGvxpwtGVMEGp+mqpC4kE87lmt36M="; 24 }; 25 26 patches = [ 27 # disable postcss-import-url 28 ./dont-vendor-remote-fonts.patch 29 30 # populates the lib/generated directory 31 ./add-generated-files.patch 32 ]; 33 34 postPatch = '' 35 # don't generate i18n and graphql code 36 substituteInPlace frontend/package.json \ 37 --replace-fail '"postinstall":' '"_postinstall":' 38 ''; 39 40 nativeBuildInputs = [ 41 nodejs 42 pnpm_8.configHook 43 wails 44 wrapGAppsHook3 45 copyDesktopItems 46 ]; 47 48 buildInputs = [ 49 glib-networking 50 ]; 51 52 # we use env because buildGoModule doesn't forward all normal attrs 53 # this is pretty hacky 54 env = { 55 pnpmDeps = pnpm_8.fetchDeps { 56 inherit pname version src; 57 sourceRoot = "${src.name}/frontend"; 58 fetcherVersion = 1; 59 hash = "sha256-OP+3zsNlvqLFwvm2cnBd2bj2Kc3EghQZE3hpotoqqrQ="; 60 }; 61 62 pnpmRoot = "frontend"; 63 }; 64 65 # running this caches some additional dependencies for the FOD 66 overrideModAttrs = { 67 preBuild = '' 68 wails build 69 ''; 70 }; 71 72 proxyVendor = true; 73 74 vendorHash = "sha256-3nsJPuwL2Zw/yuHvd8rMSpj9DBBpYUaR19z9TSV/7jg="; 75 76 buildPhase = '' 77 runHook preBuild 78 wails build 79 runHook postBuild 80 ''; 81 82 installPhase = '' 83 runHook preInstall 84 install -Dm755 build/bin/SatisfactoryModManager -t "$out/bin" 85 86 for i in 16 32 64 128 256 512; do 87 install -D ./icons/"$i"x"$i".png "$out"/share/icons/hicolor/"$i"x"$i"/apps/SatisfactoryModManager.png 88 done 89 runHook postInstall 90 ''; 91 92 desktopItems = [ 93 (makeDesktopItem { 94 name = "SatisfactoryModManager"; 95 desktopName = "Satisfactory Mod Manager"; 96 exec = "SatisfactoryModManager %u"; 97 mimeTypes = [ "x-scheme-handler/smmanager" ]; 98 icon = "SatisfactoryModManager"; 99 terminal = false; 100 categories = [ "Game" ]; 101 }) 102 ]; 103 104 meta = { 105 broken = stdenv.hostPlatform.isDarwin; 106 description = "Mod manager and modloader for Satisfactory"; 107 homepage = "https://github.com/satisfactorymodding/SatisfactoryModManager"; 108 license = lib.licenses.gpl3Only; 109 mainProgram = "SatisfactoryModManager"; 110 maintainers = with lib.maintainers; [ tomasajt ]; 111 platforms = lib.platforms.linux ++ lib.platforms.darwin; 112 }; 113}