From 9d9bd3f4697163869dfb0d166d96bc1d5c42ee6b Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Mon, 3 Nov 2025 03:14:15 -0500 Subject: Fix macro --- flake.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 6a0b67c..cc05aeb 100644 --- a/flake.nix +++ b/flake.nix @@ -58,6 +58,30 @@ pkgs.libglvnd pkgs.alsa-lib ]; + deps = path: nm: + let + src = lib.cleanSourceWith { + src = path; + filter = path: type: + (lib.hasSuffix "\.html" path) || + (lib.hasSuffix "\.js" path) || + (lib.hasSuffix "\.css" path) || + (lib.hasInfix "/assets/" path) || + (craneLib.filterCargoSources path type) + ; + }; + commonArgs = { + inherit src nativeBuildInputs buildInputs; + strictDeps = true; + CARGO_BUILD_TARGET = "x86_64-unknown-linux-gnu"; + CARGO_BUILD_RUSTFLAGS="-L ${glfw}/lib"; + inherit (craneLib.crateNameFromCargoToml { inherit src; }) version; + }; + cargoArtifacts = craneLib.buildDepsOnly (commonArgs // { + doCheck = false; + }); + in + cargoArtifacts; build = path: nm: let src = lib.cleanSourceWith { @@ -199,5 +223,8 @@ default = shell; windows = windows.shell; }; + packages.${system} = { + default = native.deps ./. "teleia"; + }; }; } -- cgit v1.2.3