diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ca0d8f3..391c3a5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,3 @@ repos: - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files - - repo: https://github.com/nix-community/nixpkgs-fmt - rev: v1.3.0 - hooks: - - id: nixpkgs-fmt diff --git a/home/packages/default.nix b/home/packages/default.nix index 22d4225..e470506 100644 --- a/home/packages/default.nix +++ b/home/packages/default.nix @@ -1,6 +1,7 @@ { pkgs, osConfig, ... }: let withCuda = if (osConfig.system.name == "gunter") then true else false; + pob = pkgs.qt6Packages.callPackage ../../packages/pob.nix { }; in { home.packages = with pkgs; [ @@ -28,8 +29,8 @@ in kubectl ncdu nvd + nurl nwg-look - path-of-building pinentry pre-commit pulseaudio @@ -105,5 +106,7 @@ in (btop.override { cudaSupport = withCuda; }) # PrismLauncher (prismlauncher.override { withWaylandGLFW = true; }) + + pob ]; } diff --git a/packages/pob.nix b/packages/pob.nix new file mode 100644 index 0000000..1871f5c --- /dev/null +++ b/packages/pob.nix @@ -0,0 +1,94 @@ +{ + stdenv, + lib, + fetchFromGitHub, + unzip, + meson, + ninja, + pkg-config, + qtbase, + qttools, + wrapQtAppsHook, + luajit, +}: +let + data = stdenv.mkDerivation (finalAttrs: { + pname = "path-of-building-data"; + version = "2.43.0-beta"; + + src = fetchFromGitHub { + owner = "PathOfBuildingCommunity"; + repo = "PathOfBuilding"; + rev = "acd1fb5abbdd571345e1dd960e72b9be12a555a8"; + hash = "sha256-E7UgJpsC0YnqG2KbZYxbYRDPoZ2+NfyYCn4fK+QN5WM="; + }; + + nativeBuildInputs = [ unzip ]; + + buildCommand = '' + # I have absolutely no idea how this file is generated + # and I don't think I want to know. The Flatpak also does this. + unzip -j -d $out $src/runtime-win32.zip lua/sha1.lua + + # Install the actual data + cp -r $src/src $src/runtime/lua/*.lua $src/manifest.xml $out + + # Pretend this is an official build so we don't get the ugly "dev mode" warning + substituteInPlace $out/manifest.xml --replace ' $out/src/UpdateCheck.lua + ''; + }); +in +stdenv.mkDerivation { + pname = "path-of-building"; + version = "${data.version}-unstable-2023-04-09"; + + src = fetchFromGitHub { + owner = "ernstp"; + repo = "pobfrontend"; + rev = "9faa19aa362f975737169824c1578d5011487c18"; + hash = "sha256-zhw2PZ6ZNMgZ2hG+a6AcYBkeg7kbBHNc2eSt4if17Wk="; + }; + + nativeBuildInputs = [ + meson + ninja + pkg-config + qttools + wrapQtAppsHook + ]; + buildInputs = [ + qtbase + luajit + luajit.pkgs.lua-curl + ]; + + installPhase = '' + runHook preInstall + install -Dm555 pobfrontend $out/bin/pobfrontend + runHook postInstall + ''; + + preFixup = '' + qtWrapperArgs+=( + --set LUA_PATH "$LUA_PATH" + --set LUA_CPATH "$LUA_CPATH" + --chdir "${data}" + ) + ''; + + passthru.data = data; + + meta = { + description = "Offline build planner for Path of Exile"; + homepage = "https://pathofbuilding.community/"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.k900 ]; + mainProgram = "pobfrontend"; + broken = stdenv.isDarwin; # doesn't find uic6 for some reason + }; +}