From f78e768d4971cabd98bf078f2c0113aafbd939f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EF=BD=88=EF=BD=89=EF=BD=8C=EF=BD=8A=EF=BD=95=EF=BD=93?= =?UTF-8?q?=EF=BD=94=EF=BD=89?= Date: Thu, 13 Jan 2022 01:18:09 -0800 Subject: [PATCH] findup: init at 1.0 --- pkgs/tools/misc/findup/default.nix | 39 ++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 41 insertions(+) create mode 100644 pkgs/tools/misc/findup/default.nix diff --git a/pkgs/tools/misc/findup/default.nix b/pkgs/tools/misc/findup/default.nix new file mode 100644 index 000000000000..0b7d687922f4 --- /dev/null +++ b/pkgs/tools/misc/findup/default.nix @@ -0,0 +1,39 @@ +{ lib, stdenv, fetchFromGitHub, zig, testers, findup }: + +stdenv.mkDerivation rec { + pname = "findup"; + version = "1.0"; + + src = fetchFromGitHub { + owner = "hiljusti"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-erlKIiYYlWnhoeD3FnKdxnHjfGmmJVXk44DUja5Unig="; + }; + + nativeBuildInputs = [ zig ]; + + # Builds and installs (at the same time) with Zig. + dontConfigure = true; + dontBuild = true; + + # Give Zig a directory for intermediate work. + preInstall = '' + export HOME=$TMPDIR + ''; + + installPhase = '' + runHook preInstall + zig build -Drelease-safe -Dcpu=baseline --prefix $out + runHook postInstall + ''; + + passthru.tests.version = testers.testVersion { package = findup; }; + + meta = with lib; { + homepage = "https://github.com/hiljusti/findup"; + description = "Search parent directories for sentinel files"; + license = licenses.mit; + maintainers = with maintainers; [ hiljusti ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 61917bf54d4c..87edfd742e40 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6101,6 +6101,8 @@ with pkgs; findutils = callPackage ../tools/misc/findutils { }; + findup = callPackage ../tools/misc/findup { }; + bsd-finger = callPackage ../tools/networking/bsd-finger { }; bsd-fingerd = bsd-finger.override({ buildClient = false; });