-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nix-top_abandoned: init (let it live a bit more here)
- Loading branch information
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
}; | ||
} |
2742db7
There was a problem hiding this comment.
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)