tlmi-auth: improve overridability

Use a recursive set instead of a let in before calling
stdenv.mkDerivation. This allows to properly override the derivation
with overrideAttrs.

Do not re-use the pname in the fetcher function. Otherwise you cannot
override the pname of a derivation while still fetching the same
sources. However, this is something you sometimes want to do.
This commit is contained in:
nikstur 2024-02-02 16:49:13 +01:00
parent 241fca1ece
commit 9ec3d89500

View File

@ -6,18 +6,15 @@
, ninja
, openssl
}:
let
name = "tlmi-auth";
stdenv.mkDerivation (finalAttrs: {
pname = "tlmi-auth";
version = "1.0.1";
in
stdenv.mkDerivation {
pname = name;
version = version;
src = fetchFromGitHub {
owner = "lenovo";
repo = name;
rev = "v${version}";
repo = "tlmi-auth";
rev = "v${finalAttrs.version}";
hash = "sha256-/juXQrb3MsQ6FxmrAa7E1f0vIMu1397tZ1pzLfr56M4=";
};
@ -32,8 +29,8 @@ stdenv.mkDerivation {
homepage = "https://github.com/lenovo/tlmi-auth";
maintainers = with maintainers; [ snpschaaf ];
description = "Utility for creating signature strings needed for thinklmi certificate based authentication";
mainProgram = name;
mainProgram = "tlmi-auth";
license = licenses.gpl2;
platforms = platforms.linux;
};
}
})