-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.nix
More file actions
125 lines (95 loc) · 2.88 KB
/
scripts.nix
File metadata and controls
125 lines (95 loc) · 2.88 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{ pkgs }:
let
# Helper function to create a shell script package
mkShellScript = name: description: pkgs.stdenvNoCC.mkDerivation {
pname = name;
version = "0.0.1";
src = ./.;
dontBuild = true;
installPhase = ''
mkdir -p $out/bin
cp scripts/${name} $out/bin/${name}
chmod +x $out/bin/${name}
runHook postInstall
'';
meta = {
inherit description;
platforms = pkgs.lib.platforms.all;
};
};
in
{
# Curl and Execute scripts from shared repository
cex = mkShellScript "cex" "Curl and Execute scripts from shared repository";
# Code formatting script
fmt = mkShellScript "fmt" "Format code files (Go, JS/TS, Python, Shell, Nix)";
# Code linting script
lint = mkShellScript "lint" "Lint code files (Go, JS/TS, Python, Shell, Nix)";
# Code tidying script
tidy = mkShellScript "tidy" "Clean up and organize code";
# Dependency upgrade script
upgrade = mkShellScript "upgrade" "Upgrade dependencies and tools";
# Fuzzing test script
fuzz = mkShellScript "fuzz" "Run fuzzing tests";
# Python scripts (these might need different handling if they have dependencies)
fuzz-go = pkgs.stdenvNoCC.mkDerivation {
pname = "fuzz-go";
version = "0.0.1";
src = ./.;
dontBuild = true;
nativeBuildInputs = [ pkgs.makeWrapper ];
installPhase = ''
mkdir -p $out/bin
cp scripts/fuzz_go.py $out/bin/fuzz-go
chmod +x $out/bin/fuzz-go
# Wrap with python interpreter
wrapProgram $out/bin/fuzz-go \
--prefix PATH : ${pkgs.python3}/bin
runHook postInstall
'';
meta = {
description = "Go fuzzing test runner";
platforms = pkgs.lib.platforms.all;
};
};
license = pkgs.stdenvNoCC.mkDerivation {
pname = "license";
version = "0.0.1";
src = ./.;
dontBuild = true;
nativeBuildInputs = [ pkgs.makeWrapper ];
installPhase = ''
mkdir -p $out/bin
cp scripts/license.py $out/bin/license
chmod +x $out/bin/license
# Wrap with python interpreter
wrapProgram $out/bin/license \
--prefix PATH : ${pkgs.python3}/bin
runHook postInstall
'';
meta = {
description = "Manage license headers";
platforms = pkgs.lib.platforms.all;
};
};
tag = pkgs.stdenvNoCC.mkDerivation {
pname = "tag";
version = "0.0.1";
src = ./.;
dontBuild = true;
nativeBuildInputs = [ pkgs.makeWrapper ];
installPhase = ''
mkdir -p $out/bin
cp scripts/tag.py $out/bin/tag
chmod +x $out/bin/tag
# Wrap with python interpreter
wrapProgram $out/bin/tag \
--prefix PATH : ${pkgs.python3}/bin
runHook postInstall
'';
meta = {
description = "Manage version tags";
platforms = pkgs.lib.platforms.all;
};
};
}