fetchFromGitHub: force re-fetch when rev changes

Prefix the default value of `name` with `rev` to force re-fetch
everytime `rev` changes.
This commit is contained in:
Yueh-Shun Li 2024-03-09 00:10:12 +08:00 committed by Abhiram
parent be166796d2
commit ff4126b6ba

View file

@ -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