-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackage.nix
74 lines (62 loc) · 1.26 KB
/
package.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{
lib,
stdenv,
fetchFromGitHub,
bash,
fzf,
jq,
micro,
git,
nix-tree,
coreutils,
makeWrapper,
dialog,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "nixedit";
version = "1.1.0";
src = fetchFromGitHub {
owner = "fndov";
repo = "nixedit";
rev = "388013c0e762027905b079e3fe89d44dfc495d09";
hash = "sha256-s+xFakiKODAPEDQCEo0JudQBrVQr6Br7OzBN5JoMOnE=";
};
nativeBuildInputs = [
makeWrapper
];
buildInputs = [
bash
fzf
jq
micro
git
nix-tree
coreutils
dialog
];
installPhase = ''
runHook reInstall
mkdir -p $out/bin
mv src/nixedit.sh $out/bin/nixedit
chmod +x $out/bin/nixedit
runHook postInstall
'';
postFixup = ''
wrapProgram $out/bin/nixedit \
--prefix PATH : "${lib.makeBinPath finalAttrs.buildInputs}"
'';
installCheckPhase = ''
if ! uname -a | grep "NixOS" > /dev/null; then
echo "nxiedit package can only be installed on NixOS."
exit 1
fi
'';
meta = with lib; {
homepage = "https://github.com/fndov/nixedit";
description = "NixOS Multipurpose CLI/TUI Utility";
license = licenses.gpl3;
mainProgram = "nixedit";
maintainers = with maintainers; [ miyu ];
platforms = lib.platforms.linux;
};
})