From f6e5ea8a2c0872acd83b98dd37e32f28006407b7 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Mon, 23 Jan 2023 22:58:03 +0100 Subject: [PATCH 1/2] documentation-highlighter: Only depend on needed files Makes the build independency of the default.nix and update.sh file by explicitly specifying the files that are needed in the result This allows changing those files without causing a rebuild --- pkgs/misc/documentation-highlighter/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/misc/documentation-highlighter/default.nix b/pkgs/misc/documentation-highlighter/default.nix index 2a34e36742d5..22ea3a5f86e3 100644 --- a/pkgs/misc/documentation-highlighter/default.nix +++ b/pkgs/misc/documentation-highlighter/default.nix @@ -7,6 +7,16 @@ runCommand "documentation-highlighter" { platforms = lib.platforms.all; maintainers = [ lib.maintainers.grahamc ]; }; + src = lib.sources.cleanSourceWith { + src = ./.; + filter = path: type: lib.elem path (map toString [ + ./highlight.pack.js + ./LICENSE + ./loader.js + ./mono-blue.css + ./README.md + ]); + }; } '' - cp -r ${./.} $out + cp -r "$src" "$out" '' From ebc0798e95e57fcaea460b11507ad0001645adc9 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Mon, 23 Jan 2023 22:59:27 +0100 Subject: [PATCH 2/2] zsh-clipboard: Make independent of Nix file This way, changing the Nix file won't change the derivation --- pkgs/shells/zsh/zsh-clipboard/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/shells/zsh/zsh-clipboard/default.nix b/pkgs/shells/zsh/zsh-clipboard/default.nix index eb395d744728..312731e7cb16 100644 --- a/pkgs/shells/zsh/zsh-clipboard/default.nix +++ b/pkgs/shells/zsh/zsh-clipboard/default.nix @@ -4,13 +4,12 @@ stdenv.mkDerivation rec { pname = "zsh-clipboard"; version = "1.0"; - src = ./.; - + dontUnpack = true; strictDeps = true; dontBuild = true; installPhase = '' - install -D -m0444 -t $out/share/zsh/plugins/clipboard ./clipboard.plugin.zsh + install -D -m0444 -T ${./clipboard.plugin.zsh} $out/share/zsh/plugins/clipboard/clipboard.plugin.zsh ''; meta = with lib; {