From b6b297f1acfb061a5e333c525ec70fe50b492f5d Mon Sep 17 00:00:00 2001 From: Jack Wines Date: Wed, 29 Jul 2026 01:25:43 -0400 Subject: [PATCH] Nix: add miniz and fix submodules (#2220) * nix: add miniz to dependencies * nix: enable parallel building * amend! nix: add miniz to dependencies nix: add miniz to dependencies * nix: remove enableParellelBulding, needSubmodules The flake now includes submodules in inputs, so we no longer need to throw an error when they aren't there. EnableParallelBuilding was added in error, cmake already compiles in parallel when under nix. --- flake.nix | 45 ++++++++++++++++++--------------------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/flake.nix b/flake.nix index 6be8c03aef..c470446113 100644 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,7 @@ description = "Dusklight — native PC port of the Twilight Princess decompilation"; inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + inputs.self.submodules = true; outputs = { self, nixpkgs }: @@ -58,21 +59,6 @@ hasNodPrebuilt = nodPrebuiltInfo ? ${system}; aurora = builtins.pathExists "${self}/extern/aurora/CMakeLists.txt"; - needSubmodules = '' - dusklight: The aurora submodule is not vendored. Add submodules=1 to build. - - As a flake input: - - dusklight.url = "git+https://github.com/TwilitRealm/dusklight?ref=main&submodules=1"; - - nix command: - - nix run 'git+https://github.com/TwilitRealm/dusklight?submodules=1' - - Local checkout: - - nix run '.?submodules=1#dusklight' - ''; dawn = pkgs.fetchzip { url = "https://github.com/encounter/dawn/releases/download/${dawnVersion}/dawn-${dawnInfo.${system}.triple}.tar.gz"; @@ -140,6 +126,14 @@ JSON = pkgs.nlohmann_json.src; XXHASH = pkgs.xxhash.src; ZSTD = pkgs.zstd.src; + + + MINIZ = pkgs.fetchzip { + url = "https://github.com/richgel999/miniz/releases/download/3.0.2/miniz-3.0.2.zip"; + hash = "sha256-DXysXkQEmoDAMMg1F8KexkwpXNyiHNzLJqXR9SMEkxk="; + stripRoot = false; + }; + FMT = pkgs.fetchzip { url = "https://github.com/fmtlib/fmt/archive/refs/tags/12.1.0.tar.gz"; hash = "sha256-ZmI1Dv0ZabPlxa02OpERI47jp7zFfjpeWCy1WyuPYZ0="; @@ -165,19 +159,16 @@ }; dusklight = - if !aurora then - throw needSubmodules - else - pkgs.stdenv.mkDerivation { - pname = "dusklight"; - version = versionSuffix; - src = ./.; + pkgs.stdenv.mkDerivation { + pname = "dusklight"; + version = versionSuffix; + src = ./.; - postUnpack = '' - chmod -R u+w "$sourceRoot" - substituteInPlace "$sourceRoot/extern/aurora/CMakeLists.txt" \ - --replace-warn "add_subdirectory(tests)" "" - ''; + postUnpack = '' + chmod -R u+w "$sourceRoot" + substituteInPlace "$sourceRoot/extern/aurora/CMakeLists.txt" \ + --replace-warn "add_subdirectory(tests)" "" + ''; nativeBuildInputs = [ pkgs.cmake