Skip to content

Commit

Permalink
feat: modorganizer2-linux-installer
Browse files Browse the repository at this point in the history
  • Loading branch information
zeorin committed Aug 10, 2024
1 parent 9e0facc commit b812f0a
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions home-manager/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5806,6 +5806,7 @@ in {
spotify
# https://github.com/NixOS/nixpkgs/issues/179323
prismlauncher
modorganizer2-linux-installer
manix
cachix
nix-prefetch-git
Expand Down
2 changes: 2 additions & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ with pkgs;
tabfs-unwrapped = callPackage ./tabfs { };
tabfs = wrapTabfs tabfs-unwrapped { };
vscode-js-debug = callPackage ./vscode-js-debug { };
modorganizer2-linux-installer =
callPackage ./modorganizer2-linux-installer { };
}
50 changes: 50 additions & 0 deletions pkgs/modorganizer2-linux-installer/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{ lib, pkgsCross, stdenvNoCC, fetchFromGitHub, fetchurl, makeDesktopItem, p7zip
, gnome, curl, protontricks, makeWrapper }:

let
version = "4.6.1";
src = fetchFromGitHub {
owner = "rockerbacon";
repo = "modorganizer2-linux-installer";
rev = version;
hash = "sha256-SI1XDWp2uDR1QJx9iGB1F1ixHOMiarHGEvLX6WLo8Zc=";
};

steam-redirector = pkgsCross.mingwW64.callPackage ({ stdenv, windows }:
stdenv.mkDerivation {
pname = "steam-redirector";
inherit version;
src = "${src}/steam-redirector";
buildInputs = [ windows.mingw_w64_pthreads ];
installPhase = ''
mkdir -p $out/bin
cp main.exe $out/bin
'';
}) { };

in stdenvNoCC.mkDerivation (finalAttrs: {
pname = "modorganizer2-linux-installer";
inherit version src;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
mkdir -p $out/lib $out/bin
cp -r ./* $out/lib
cp ${steam-redirector}/bin/main.exe $out/lib/steam-redirector
makeWrapper $out/lib/install.sh $out/bin/modorganizer2-linux-installer \
--prefix PATH : "${
lib.makeBinPath [ p7zip curl gnome.zenity protontricks ]
}"
'';
desktopItem = makeDesktopItem {
name = finalAttrs.pname;
desktopName = "Mod Organizer 2 Linux Installer";
exec = "modorganizer2-linux-installer";
categories = [ "Game" ];
};
meta = with lib; {
description = "An easy-to-use Mod Organizer 2 installer for Linux";
homepage = "https://github.com/rockerbacon/modorganizer2-linux-installer";
mainProgram = "modorganizer2-linux-installer";
license = licenses.mit;
};
})

0 comments on commit b812f0a

Please sign in to comment.