-
Notifications
You must be signed in to change notification settings - Fork 2
/
devenv.nix
143 lines (122 loc) · 3.41 KB
/
devenv.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
{ pkgs, lib, config, inputs, ... }:
{
name = "neuronek";
# Integrate delta into Git
delta.enable = true;
# Enable .devcontainer.json generation
devcontainer.enable = true;
devcontainer.settings.customizations.vscode.extensions = [
"mkhl.direnv"
"prisma.prisma"
];
# Enable dotenv integration
dotenv.enable = true;
dotenv.disableHint = true;
# Enable languages related to project
# https://devenv.sh/languages/#supported-languages
# https://devenv.sh/basics/
env.DIRENV_LOG_FORMAT = "";
# https://devenv.sh/packages/
packages = [
pkgs.git
pkgs.jq
pkgs.fet-sh
# JavaScript Tooling
pkgs.prettierd
pkgs.turbo
# Python Tooling
pkgs.rye
pkgs.uv
pkgs.ruff
# Node.js Global Packages
pkgs.nodePackages_latest.prisma
pkgs.nodePackages_latest.prettier
# Node.js Experimental Toolchain
pkgs.rslint
pkgs.oxlint
pkgs.ezno
pkgs.eslint_d
pkgs.go-task
pkgs.just
pkgs.nixpacks
pkgs.tbls
pkgs.git-lfs
# Nix-related Tools
pkgs.nil
pkgs.git-extras
pkgs.lolcat
pkgs.nitch
];
# https://devenv.sh/scripts/
scripts.hello.exec = "echo hello from $GREET";
scripts = {
dev = {
exec="pnpm dev";
description="Starts development environment with all of the dependencies";
};
};
enterShell = ''
echo Setting up a database...
pnpm run db:migrate:deploy
clear
nitch
echo
echo 🦾 Helper scripts you can run to make your development richer:
echo
${pkgs.gnused}/bin/sed -e 's| |••|g' -e 's|=| |' <<EOF | ${pkgs.util-linuxMinimal}/bin/column -t | ${pkgs.gnused}/bin/sed -e 's|^|-> |' -e 's|••| |g'
${lib.generators.toKeyValue {} (lib.mapAttrs (name: value: value.description) config.scripts)}
EOF
echo
'';
# https://devenv.sh/tests/
enterTest = ''
echo "Running tests"
git --version | grep "2.42.0"
'';
# https://devenv.sh/services/
services.postgres.enable = true;
services.redis.enable = true;
services.minio.enable = true;
services.vault.enable = true;
# https://devenv.sh/languages/
languages.nix.enable = true;
languages = {
typescript = {
enable = true;
};
terraform = {
enable = true;
};
javascript = {
enable = true;
bun.enable = true;
corepack.enable = true;
pnpm.enable = true;
pnpm.install.enable = true;
};
python.enable=true;
};
# https://devenv.sh/pre-commit-hooks/
pre-commit.enabledPackages = [
pkgs.actionlint
pkgs.alejandra
pkgs.checkmake
pkgs.datalad
];
pre-commit.hooks.shellcheck.enable = true;
pre-commit.hooks.annex.enable = true;
pre-commit.hooks.statix.enable = true;
pre-commit.hooks.tflint.enable = true;
pre-commit.hooks.topiary.enable = true;
pre-commit.hooks.ruff.enable = true;
pre-commit.hooks.ripsecrets.enable = true;
pre-commit.hooks.pretty-format-json.enable = true;
pre-commit.hooks.nil.enable = true;
pre-commit.hooks.beautysh.enable = true;
pre-commit.hooks.eslint.enable=true;
# https://devenv.sh/processes/
processes.ping.exec = "ping example.com";
# See full reference at https://devenv.sh/reference/options/
starship.enable = true;
starship.config.enable = true;
}