diff --git a/default.nix b/default.nix index e1cdf024..44b84c47 100644 --- a/default.nix +++ b/default.nix @@ -6,7 +6,7 @@ }: let - inherit (pkgs) binutils gnutar lib mktemp stdenv zip; + inherit (pkgs) binutils gnutar lib mktemp stdenv wine zip; inherit (crossPkgs) buildPlatform hostPlatform; mkToolchain = import ./rust-toolchain.nix { inherit lib fenix; }; @@ -54,8 +54,10 @@ himalaya.overrideAttrs (drv: { propagatedBuildInputs = (drv.propagatedBuildInputs or [ ]) ++ lib.optional hostPlatform.isWindows empty-libgcc_eh; + # NOTE: manual wineprefix update is somehow needed: + # postInstall = (drv.postInstall or "") + lib.optionalString hostPlatform.isWindows '' - export WINEPREFIX="$(${lib.getExe' mktemp "mktemp"} -d)" + ${lib.getExe' wine "wineboot"} -u '' + '' mkdir -p $out/bin/share/{applications,completions,man,services} cp assets/himalaya.desktop $out/bin/share/applications/ diff --git a/flake.nix b/flake.nix index c0f1b168..c0675952 100644 --- a/flake.nix +++ b/flake.nix @@ -34,6 +34,11 @@ ]; }; + withGitEnvs = package: package.overrideAttrs (drv: { + GIT_REV = drv.GIT_REV or self.rev or self.dirtyRev or "unknown"; + GIT_DESCRIBE = drv.GIT_DESCRIBE or "nix-flake-" + self.lastModifiedDate; + }); + # Dev shells mkDevShell = system: { @@ -52,11 +57,6 @@ })); }; - withGitEnvs = package: package.overrideAttrs (drv: { - GIT_REV = drv.GIT_REV or self.rev or self.dirtyRev or "dirty"; - GIT_DESCRIBE = drv.GIT_DESCRIBE or "flake-" + self.shortRev or self.dirtyShortRev or "dirty"; - }); - mkCrossPackages = system: lib.attrsets.mergeAttrsList (map (mkCrossPackage system) crossSystems.${system});