From d9480c60b72e8c7d55e128c25415bf7fe7d6187a Mon Sep 17 00:00:00 2001 From: connerohnesorge Date: Tue, 10 Jun 2025 12:40:53 -0500 Subject: [PATCH] Fix inefficient copy warning by using self instead of ./. in nix derivation As suggested by the Determinate Nix changelog, replace the relative path reference with the flake's self input to avoid unnecessary copying to the store. This improves evaluation performance and reduces file copies. References: https://determinate.systems/posts/changelog-determinate-nix-362/#track-down-and-fix-inefficient-double-copy-causes --- flake.nix | 1 + nix/default.nix | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 0ce6c61..15133be 100644 --- a/flake.nix +++ b/flake.nix @@ -32,6 +32,7 @@ hyprland-protocols = final: prev: { hyprland-protocols = final.callPackage ./nix/default.nix { version = version + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty"); + inherit self; }; }; }; diff --git a/nix/default.nix b/nix/default.nix index 62b7ed4..a3a7677 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -4,12 +4,13 @@ meson, ninja, version, + self, }: stdenv.mkDerivation { pname = "hyprland-protocols"; inherit version; - src = ../.; + src = self; nativeBuildInputs = [meson ninja];