-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
flake.nix
150 lines (142 loc) · 3.36 KB
/
flake.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
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
{
description = "Nix Community Templates";
outputs = {self}: let
mkWelcomeText = {
name,
description,
path,
buildTools ? null,
additionalSetupInfo ? null,
}: {
inherit path;
description = name;
welcomeText = ''
# ${name}
${description}
${
if buildTools != null
then ''
Comes bundled with:
${builtins.concatStringsSep ", " buildTools}
''
else ""
}
${
if additionalSetupInfo != null
then ''
## Additional Setup
To set up the project run:
```sh
flutter create .
```
''
else ""
}
## Other tips
If you use direnv run:
```
echo "use flake" > .envrc
```
For a quick license setup use licensor:
```
# SPDX is the license id like MIT or GPL-3.0
nix-shell -p licensor --command "licensor SPDX > LICENSE"
```
## More info
- [flake-utils Github Page](https://github.com/numtide/flake-utils)
'';
};
in {
templates = {
empty = mkWelcomeText {
name = "Empty Template";
description = ''
A simple flake that provides a devshell
'';
path = ./empty;
};
rust = mkWelcomeText {
path = ./rust;
name = "Rust Template";
description = ''
A basic rust application template with a package build.
'';
buildTools = [
"All essential rust tools"
"rust-analyzer"
];
};
zig = mkWelcomeText {
path = ./zig;
name = "Zig Template";
description = ''
A basic Zig application template with a package build.
'';
buildTools = [
"zig"
"zls"
];
};
go = mkWelcomeText {
path = ./go;
name = "Go template";
description = "A basic go project";
buildTools = [
"go"
"gopls"
];
};
python = mkWelcomeText {
path = ./python;
name = "Python Template";
description = ''
A basic python project
'';
buildTools = [
"python310"
];
};
haskell = mkWelcomeText {
path = ./haskell;
name = "Haskell Template";
description = ''
A basic haskell project with cabal
'';
buildTools = [
"cabal"
"ghc"
"haskell-language-server"
];
};
flutter = mkWelcomeText {
path = ./flutter;
name = "Flutter Template";
description = ''
A flutter project template that comes bundled
'';
};
nextjs = mkWelcomeText {
path = ./nextjs;
name = "NextJS Template";
description = ''
A basic NextJS application template with a package build.
'';
buildTools = [
"nodejs"
"pnpm"
];
};
c = mkWelcomeText {
path = ./c;
name = "C Template";
description = ''
A basic C application template with a package build.
Lots of comments to help you configure it to your liking.
'';
buildTools = [
"gcc"
];
};
};
};
}