Skip to content

Commit 4954b46

Browse files
committed
chore: Add devenv.
1 parent 551c7fb commit 4954b46

File tree

5 files changed

+198
-0
lines changed

5 files changed

+198
-0
lines changed

.envrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export DIRENV_WARN_TIMEOUT=20s
2+
3+
eval "$(devenv direnvrc)"
4+
5+
# The use_devenv function supports passing flags to the devenv command
6+
# For example: use devenv --impure --option services.postgres.enable:bool true
7+
use devenv

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,13 @@ phoenix_session_process-*.tar
2424

2525
# Temporary files, for example, from tests.
2626
/tmp/
27+
28+
# Devenv
29+
.devenv*
30+
devenv.local.nix
31+
32+
# direnv
33+
.direnv
34+
35+
# pre-commit
36+
.pre-commit-config.yaml

devenv.lock

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
"nodes": {
3+
"devenv": {
4+
"locked": {
5+
"dir": "src/modules",
6+
"lastModified": 1756910489,
7+
"owner": "cachix",
8+
"repo": "devenv",
9+
"rev": "f86a13b10d1b5ae2168ba58edd72b6a04cad003e",
10+
"type": "github"
11+
},
12+
"original": {
13+
"dir": "src/modules",
14+
"owner": "cachix",
15+
"repo": "devenv",
16+
"type": "github"
17+
}
18+
},
19+
"flake-compat": {
20+
"flake": false,
21+
"locked": {
22+
"lastModified": 1747046372,
23+
"owner": "edolstra",
24+
"repo": "flake-compat",
25+
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
26+
"type": "github"
27+
},
28+
"original": {
29+
"owner": "edolstra",
30+
"repo": "flake-compat",
31+
"type": "github"
32+
}
33+
},
34+
"git-hooks": {
35+
"inputs": {
36+
"flake-compat": "flake-compat",
37+
"gitignore": "gitignore",
38+
"nixpkgs": [
39+
"nixpkgs"
40+
]
41+
},
42+
"locked": {
43+
"lastModified": 1755960406,
44+
"owner": "cachix",
45+
"repo": "git-hooks.nix",
46+
"rev": "e891a93b193fcaf2fc8012d890dc7f0befe86ec2",
47+
"type": "github"
48+
},
49+
"original": {
50+
"owner": "cachix",
51+
"repo": "git-hooks.nix",
52+
"type": "github"
53+
}
54+
},
55+
"gitignore": {
56+
"inputs": {
57+
"nixpkgs": [
58+
"git-hooks",
59+
"nixpkgs"
60+
]
61+
},
62+
"locked": {
63+
"lastModified": 1709087332,
64+
"owner": "hercules-ci",
65+
"repo": "gitignore.nix",
66+
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
67+
"type": "github"
68+
},
69+
"original": {
70+
"owner": "hercules-ci",
71+
"repo": "gitignore.nix",
72+
"type": "github"
73+
}
74+
},
75+
"nixpkgs": {
76+
"locked": {
77+
"lastModified": 1755783167,
78+
"owner": "cachix",
79+
"repo": "devenv-nixpkgs",
80+
"rev": "4a880fb247d24fbca57269af672e8f78935b0328",
81+
"type": "github"
82+
},
83+
"original": {
84+
"owner": "cachix",
85+
"ref": "rolling",
86+
"repo": "devenv-nixpkgs",
87+
"type": "github"
88+
}
89+
},
90+
"nixpkgs-stable": {
91+
"locked": {
92+
"lastModified": 1756974490,
93+
"owner": "nixos",
94+
"repo": "nixpkgs",
95+
"rev": "cb4190e6276d053ee2bb6c0b8acfc3de74ec3ec3",
96+
"type": "github"
97+
},
98+
"original": {
99+
"owner": "nixos",
100+
"ref": "release-25.05",
101+
"repo": "nixpkgs",
102+
"type": "github"
103+
}
104+
},
105+
"nixpkgs-unstable": {
106+
"locked": {
107+
"lastModified": 1756819007,
108+
"owner": "nixos",
109+
"repo": "nixpkgs",
110+
"rev": "aaff8c16d7fc04991cac6245bee1baa31f72b1e1",
111+
"type": "github"
112+
},
113+
"original": {
114+
"owner": "nixos",
115+
"ref": "nixpkgs-unstable",
116+
"repo": "nixpkgs",
117+
"type": "github"
118+
}
119+
},
120+
"root": {
121+
"inputs": {
122+
"devenv": "devenv",
123+
"git-hooks": "git-hooks",
124+
"nixpkgs": "nixpkgs",
125+
"nixpkgs-stable": "nixpkgs-stable",
126+
"nixpkgs-unstable": "nixpkgs-unstable",
127+
"pre-commit-hooks": [
128+
"git-hooks"
129+
]
130+
}
131+
}
132+
},
133+
"root": "root",
134+
"version": 7
135+
}

devenv.nix

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{ pkgs, lib, config, inputs, ... }:
2+
3+
let
4+
pkgs-stable = import inputs.nixpkgs-stable { system = pkgs.stdenv.system; };
5+
pkgs-unstable = import inputs.nixpkgs-unstable { system = pkgs.stdenv.system; };
6+
in
7+
{
8+
env.GREET = "Phoenix Session Process";
9+
10+
packages = [
11+
pkgs-stable.git
12+
pkgs-stable.figlet
13+
pkgs-stable.lolcat
14+
];
15+
16+
languages.elixir.enable = true;
17+
languages.elixir.package = pkgs-stable.beam27Packages.elixir;
18+
19+
scripts.hello.exec = ''
20+
figlet -w 120 $GREET | lolcat
21+
'';
22+
23+
enterShell = ''
24+
hello
25+
'';
26+
27+
}

devenv.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
2+
inputs:
3+
nixpkgs:
4+
url: github:cachix/devenv-nixpkgs/rolling
5+
nixpkgs-stable:
6+
url: github:nixos/nixpkgs/release-25.05
7+
nixpkgs-unstable:
8+
url: github:nixos/nixpkgs/nixpkgs-unstable
9+
10+
# If you're using non-OSS software, you can set allowUnfree to true.
11+
allowUnfree: true
12+
13+
# If you're willing to use a package that's vulnerable
14+
# permittedInsecurePackages:
15+
# - "openssl-1.1.1w"
16+
17+
# If you have more than one devenv you can merge them
18+
#imports:
19+
# - ./backend

0 commit comments

Comments
 (0)