From 2ebe93cb8caf8c07efaa8d8723503c6c4028cc8d Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Sat, 30 Mar 2024 16:39:19 +0100 Subject: [PATCH] httpdirfs: add passthru.{tests.version,updateScript} --- pkgs/tools/filesystems/httpdirfs/default.nix | 21 ++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/filesystems/httpdirfs/default.nix b/pkgs/tools/filesystems/httpdirfs/default.nix index 1d4952edcbf9..caf75a26b74c 100644 --- a/pkgs/tools/filesystems/httpdirfs/default.nix +++ b/pkgs/tools/filesystems/httpdirfs/default.nix @@ -6,18 +6,20 @@ gumbo, lib, libuuid, + nix-update-script, pkg-config, stdenv, + testers, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "httpdirfs"; version = "1.2.3"; src = fetchFromGitHub { owner = "fangfufu"; - repo = pname; - rev = "refs/tags/${version}"; + repo = "httpdirfs"; + rev = "refs/tags/${finalAttrs.version}"; sha256 = "sha256-rdeBlAV3t/si9x488tirUGLZRYAxh13zdRIQe0OPd+A="; }; @@ -33,6 +35,17 @@ stdenv.mkDerivation rec { makeFlags = [ "prefix=${placeholder "out"}" ]; + passthru = { + # Disabled for Darwin because requires macFUSE installed outside NixOS + tests.version = lib.optionalAttrs stdenv.isLinux ( + testers.testVersion { + command = "${lib.getExe finalAttrs.finalPackage} --version"; + package = finalAttrs.finalPackage; + } + ); + updateScript = nix-update-script { }; + }; + meta = { description = "A FUSE filesystem for HTTP directory listings"; homepage = "https://github.com/fangfufu/httpdirfs"; @@ -41,4 +54,4 @@ stdenv.mkDerivation rec { maintainers = with lib.maintainers; [ sbruder schnusch ]; platforms = lib.platforms.unix; }; -} +})