-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev.nix
56 lines (56 loc) · 1.61 KB
/
dev.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
# To learn more about how to use Nix to configure your environment
# see: https://developers.google.com/idx/guides/customize-idx-env
{ pkgs, ... }: {
# Which nixpkgs channel to use.
channel = "stable-23.11"; # or "unstable"
# Use https://search.nixos.org/packages to find packages
packages = [
pkgs.inotify-tools
pkgs.elixir
pkgs.elixir_ls
];
# Sets environment variables in the workspace
env = {};
services.postgres = {
enable = true;
};
idx = {
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
extensions = [
"elixir-lsp.elixir-ls"
];
# Enable previews and customize configuration
previews = {
enable = true;
previews = {
web = {
command = ["mix" "phx.server"];
manager = "web";
env = {
PORT = "$PORT";
};
};
};
};
# Workspace lifecycle hooks
workspace = {
# Runs when a workspace is first created
onCreate = {
# Example: install JS dependencies from NPM
# npm-install = "npm install";
setup-project = ''
psql --dbname=postgres -c "CREATE USER \"postgres\" PASSWORD 'postgres' CREATEDB LOGIN;"
mix local.hex --force
mix setup
'';
# Open editors for the following files by default, if they exist:
default.openFiles = [ "README.md" ];
};
# Runs when the workspace is (re)started
onStart = {
# Example: start a background task to watch and re-build backend code
# watch-backend = "npm run watch-backend";
};
};
};
}