-
Notifications
You must be signed in to change notification settings - Fork 0
/
devenv.nix
57 lines (47 loc) · 1.55 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
{ pkgs, config, ... }:
{
# https://devenv.sh/basics/
env.ADMINER_URL = "127.0.0.1:2023";
# Enables .env file support
dotenv.enable = true;
dotenv.filename = ".env";
packages = [ pkgs.openssl ];
services = {
# enable mailpit email
mailpit = { enable = true; };
# enable mysql
mysql = {
enable = true;
# package = pkgs.mysql80;
initialDatabases = [{ name = "${config.env.DB_DATABASE}"; }];
ensureUsers = [{
name = "${config.env.DB_USER}";
password = "${config.env.DB_PASSWORD}";
ensurePermissions = {
"${config.env.DB_DATABASE}.*" = "ALL PRIVILEGES";
};
}];
};
};
# enable adminer to manage DB things
services.adminer.enable = true;
services.adminer.listen = "${config.env.ADMINER_URL}";
enterShell = ''
if [[ ! -d node_modules ]]; then
npm install
fi
export PRISMA_SCHEMA_ENGINE_BINARY="${pkgs.prisma-engines}/bin/schema-engine"
export PRISMA_QUERY_ENGINE_BINARY="${pkgs.prisma-engines}/bin/query-engine"
export PRISMA_QUERY_ENGINE_LIBRARY="${pkgs.prisma-engines}/lib/libquery_engine.node"
export PRISMA_INTROSPECTION_ENGINE_BINARY="${pkgs.prisma-engines}/bin/introspection-engine"
export PRISMA_FMT_BINARY="${pkgs.prisma-engines}/bin/prisma-fmt"
'';
# https://devenv.sh/languages/
languages.javascript = {
enable = true;
package = pkgs.nodejs-18_x;
};
# Start the frontend server
processes.start-backend.exec = "npm run start";
# See full reference at https://devenv.sh/reference/options/
}