Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixedit: init at 1.0.0 #348231

Closed
wants to merge 12 commits into from
73 changes: 73 additions & 0 deletions pkgs/tools/nix/nixedit/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
lib,
stdenv,
fetchFromGitHub,
bash,
fzf,
jq,
micro,
git,
nix-tree,
coreutils,
makeWrapper,
dialog,
}:

stdenv.mkDerivation rec {
fndov marked this conversation as resolved.
Show resolved Hide resolved
pname = "nixedit";
version = "1.0.0";

src = fetchFromGitHub {
owner = "fndov";
repo = "nixedit";
rev = "d5fd24439917b0359529aee7d29da85f20608877";
hash = "sha256-Xp7hMDjPuQyBZ535RHq5fI2r9iIeD8uC5LhHB+CB5sA=";
};

nativeBuildInputs = [
makeWrapper
];

buildInputs = [
bash
fzf
jq
micro
git
nix-tree
coreutils
dialog
];

installPhase = ''
mkdir -p $out/bin

# Copy the scripts
cp src/nixedit.sh $out/bin/nixedit

# Ensure they are executable
chmod +x $out/bin/nixedit

# Wrap nixedit to include the necessary dependencies in PATH
wrapProgram $out/bin/nixedit --prefix PATH : \
"${lib.makeBinPath buildInputs}"
'';

doInstallCheck = true;
installCheckPhase = ''
if ! uname -a | grep "NixOS" > /dev/null; then
echo "This package can only be installed on NixOS."
exit 1
fi

$out/bin/nixedit --help > /dev/null
'';

meta = with lib; {
homepage = "https://github.com/fndov/nixedit";
description = "A NixOS Multipurpose CLI/TUI Utility";
license = licenses.gpl3;
mainProgram = "nixedit";
maintainers = [ maintainers.miyu ];
};
}