diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 5b53ced9826d..53f01c93aa9e 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -25431,6 +25431,12 @@ github = "spectre256"; githubId = 72505298; }; + Sped0n = { + name = "Ryan Wen"; + email = "hi@sped0n.com"; + github = "Sped0n"; + githubId = 197479310; + }; spencerjanssen = { email = "spencerjanssen@gmail.com"; matrix = "@sjanssen:matrix.org"; diff --git a/pkgs/by-name/di/diun/package.nix b/pkgs/by-name/di/diun/package.nix new file mode 100644 index 000000000000..8a492b58ecbf --- /dev/null +++ b/pkgs/by-name/di/diun/package.nix @@ -0,0 +1,67 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, + nix-update-script, + versionCheckHook, +}: +buildGoModule (finalAttrs: { + pname = "diun"; + version = "4.31.0"; + + src = fetchFromGitHub { + owner = "crazy-max"; + repo = "diun"; + tag = "v${finalAttrs.version}"; + hash = "sha256-H05yZSH2rUrwM+ZR/PDCxXmrDkZ/Gd4RrpywGk5eW2A="; + }; + vendorHash = null; + + # upstream disable CGO in release build + # https://github.com/crazy-max/diun/blob/76c0fe99212adc58d6a3433bbcde1ffa9fb879c4/Dockerfile#L11 + env.CGO_ENABLED = false; + + ldflags = [ + "-s" + "-w" + "-X" + "main.version=${finalAttrs.version}" + ]; + + checkFlags = + let + # these tests require a network connection + skippedTests = [ + "TestTags" + "TestTagsWithDigest" + "TestCompareDigest" + "TestManifest" + "TestManifestMultiUpdatedPlatform" + "TestManifestMultiNotUpdatedPlatform" + "TestManifestVariant" + "TestManifestTaggedDigest" + "TestManifestTaggedDigestUnknownTag" + ]; + in + [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ]; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + doInstallCheck = true; + + postInstall = '' + mv $out/bin/cmd $out/bin/diun + ''; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "CLI application to receive notifications when a Docker image is updated on a Docker registry"; + homepage = "https://crazymax.dev/diun"; + changelog = "https://crazymax.dev/diun/changelog"; + license = lib.licenses.mit; + mainProgram = "diun"; + maintainers = with lib.maintainers; [ Sped0n ]; + platforms = lib.platforms.unix; + }; +})