Skip to content

Commit

Permalink
nix-top_abandoned: init (let it live a bit more here)
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroHLC committed Jun 24, 2024
1 parent 04ae587 commit 2742db7
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
2 changes: 2 additions & 0 deletions overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ in

nix-flake-schemas_git = callOverride ../pkgs/nix-flake-schemas-git { };

nix-top_abandoned = final.callPackage ../pkgs/nix-top { };

nordvpn = final.callPackage ../pkgs/nordvpn { };

nss_git = callOverride ../pkgs/nss-git { };
Expand Down
57 changes: 57 additions & 0 deletions pkgs/nix-top/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Taken from: https://github.com/NixOS/nixpkgs/blob/c00d587b1a1afbf200b1d8f0b0e4ba9deb1c7f0e/pkgs/tools/package-management/nix-top/default.nix
# SamuelDR left Nixpkgs and took his repos with him.
# Thankfully nixpkgs will still have it cached!

{ stdenv
, lib
, fetchFromGitHub
, ruby
, makeWrapper
, getent # /etc/passwd
, ncurses # tput
, binutils-unwrapped # strings
, coreutils
, findutils
}:

# No gems used, so mkDerivation is fine.
let
additionalPath = lib.makeBinPath [ getent ncurses binutils-unwrapped coreutils findutils ];
in
stdenv.mkDerivation rec {
pname = "nix-top";
version = "0.3.0";

src = (fetchFromGitHub {
owner = "samueldr";
repo = "nix-top";
rev = "v${version}";
sha256 = "sha256-w/TKzbZmMt4CX2KnLwPvR1ydp5NNlp9nNx78jJvhp54=";
});

nativeBuildInputs = [
makeWrapper
];

buildInputs = [
ruby
];

installPhase = ''
mkdir -p $out/libexec/nix-top
install -D -m755 ./nix-top $out/bin/nix-top
wrapProgram $out/bin/nix-top \
--prefix PATH : "$out/libexec/nix-top:${additionalPath}"
'' + lib.optionalString stdenv.isDarwin ''
ln -s /bin/stty $out/libexec/nix-top
'';

meta = with lib; {
description = "Tracks what nix is building";
homepage = "https://github.com/samueldr/nix-top";
license = licenses.mit;
maintainers = [];
platforms = platforms.linux ++ platforms.darwin ++ platforms.freebsd;
mainProgram = "nix-top";
};
}

1 comment on commit 2742db7

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All packages were built and cached successfully! (332 not suitable for building)

Please sign in to comment.