diff --git a/pkgs/tools/package-management/nix-top/default.nix b/pkgs/tools/package-management/nix-top/default.nix new file mode 100644 index 000000000000..b334b1270cfe --- /dev/null +++ b/pkgs/tools/package-management/nix-top/default.nix @@ -0,0 +1,50 @@ +{ stdenv +, lib +, fetchFromGitHub +, ruby +, makeWrapper +, procps # ps +, ncurses # tput +, binutils-unwrapped # strings +, findutils +}: + +# No gems used, so mkDerivation is fine. +let + additionalPath = lib.makeBinPath [ncurses procps binutils-unwrapped findutils]; +in +stdenv.mkDerivation rec { + name = "nix-top-${version}"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "samueldr"; + repo = "nix-top"; + rev = "v${version}"; + sha256 = "0l50w90hs3kmdk5kb3cwjzkx38104j6n4ssqs6jpnqfc2znagpni"; + }; + + nativeBuildInputs = [ + makeWrapper + ]; + + buildInputs = [ + ruby + ]; + + installPhase = '' + mkdir -p $out/bin/ + cp ./nix-top $out/bin/nix-top + wrapProgram $out/bin/nix-top \ + --prefix PATH : "${additionalPath}" + ''; + + meta = with lib; { + description = "Tracks what nix is building"; + homepage = https://github.com/samueldr/nix-top; + license = licenses.mit; + maintainers = with maintainers; [ samueldr ]; + platforms = platforms.linux; + inherit version; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 644f5d821e68..3447004cddae 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21301,6 +21301,8 @@ with pkgs; nix-template-rpm = callPackage ../build-support/templaterpm { inherit (pythonPackages) python toposort; }; + nix-top = callPackage ../tools/package-management/nix-top { }; + nix-repl = callPackage ../tools/package-management/nix-repl { nix = nix1; }; nix-review = callPackage ../tools/package-management/nix-review { };