-
Notifications
You must be signed in to change notification settings - Fork 0
/
devenv.nix
75 lines (64 loc) · 1.67 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
{ pkgs, lib, config, inputs, ... }:
let
pkgs-unstable = import inputs.nixpkgs-unstable { system = pkgs.stdenv.system; };
in {
# https://devenv.sh/basics/
env.GREET = "devenv";
# https://devenv.sh/packages/
packages = [
pkgs-unstable.go
pkgs-unstable.gopls
pkgs.git
pkgs.dbmate
pkgs.corepack
pkgs.prettierd
pkgs.eslint_d
pkgs.postgresql_16
];
# https://devenv.sh/services/
services.postgres = {
enable = true;
package = pkgs.postgresql_16;
listen_addresses = "127.0.0.1";
port = 5432;
initialDatabases = [
{
name = "db";
}
{
name = "testdb";
}
];
initialScript = "
CREATE USER dbmate WITH SUPERUSER PASSWORD 'dbmate';
";
};
env.DATABASE_URL = "postgresql://dbmate:[email protected]:5432/db?sslmode=disable";
env.DBMATE_MIGRATIONS_DIR = "./db/migrations";
env.DBMATE_SCHEMA_FILE = "./db/schema.sql";
env.BACKEND_ALLOW_ORIGIN = "http://localhost:3000";
env.PORT = "8080";
env.BACKEND_URL = "http://localhost:8080";
env.NEXT_PUBLIC_BACKEND_URL = "http://localhost:8080";
env.GOPLS = "${pkgs-unstable.gopls}/bin/gopls";
# https://devenv.sh/languages/
languages.typescript = {
enable = true;
};
languages.go = {
enable = true;
package = pkgs-unstable.go;
};
languages.python = {
enable = true;
uv.enable = true;
};
# https://devenv.sh/pre-commit-hooks/
# pre-commit.hooks.shellcheck.enable = true;
# https://devenv.sh/processes/
processes = {
frontend.exec = "cd frontend && npm run dev";
backend.exec = "cd backend && go run server.go";
};
# See full reference at https://devenv.sh/reference/options/
}