From ff4126b6bae88b499b75a5971958dccecff2631d Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Sat, 9 Mar 2024 00:10:12 +0800 Subject: [PATCH] fetchFromGitHub: force re-fetch when rev changes Prefix the default value of `name` with `rev` to force re-fetch everytime `rev` changes. --- pkgs/build-support/fetchgithub/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/fetchgithub/default.nix b/pkgs/build-support/fetchgithub/default.nix index 4ce3c6e..ad4d97b 100644 --- a/pkgs/build-support/fetchgithub/default.nix +++ b/pkgs/build-support/fetchgithub/default.nix @@ -1,7 +1,9 @@ { lib, fetchgit, fetchzip }: lib.makeOverridable ( -{ owner, repo, rev, name ? "source" +{ owner, repo, rev +, name ? null # Override with null to use the default value +, pname ? "source-${owner}-${repo}" , fetchSubmodules ? false, leaveDotGit ? null , deepClone ? false, private ? false, forceFetchGit ? false , sparseCheckout ? [] @@ -11,6 +13,8 @@ lib.makeOverridable ( }@args: let + name = if args.name or null != null then args.name + else "${pname}-${rev}"; position = (if args.meta.description or null != null then builtins.unsafeGetAttrPos "description" args.meta