Skip to content

Commit ad25e5d

Browse files
feat: add devenv
1 parent a283c55 commit ad25e5d

File tree

3 files changed

+170
-0
lines changed

3 files changed

+170
-0
lines changed

devenv.lock

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"nodes": {
3+
"devenv": {
4+
"locked": {
5+
"dir": "src/modules",
6+
"lastModified": 1753765820,
7+
"owner": "cachix",
8+
"repo": "devenv",
9+
"rev": "bcf3b8e29b8614ad38c34966cd52baf7f8e168b7",
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": 1750779888,
44+
"owner": "cachix",
45+
"repo": "git-hooks.nix",
46+
"rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d",
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": 1750441195,
78+
"owner": "cachix",
79+
"repo": "devenv-nixpkgs",
80+
"rev": "0ceffe312871b443929ff3006960d29b120dc627",
81+
"type": "github"
82+
},
83+
"original": {
84+
"owner": "cachix",
85+
"ref": "rolling",
86+
"repo": "devenv-nixpkgs",
87+
"type": "github"
88+
}
89+
},
90+
"root": {
91+
"inputs": {
92+
"devenv": "devenv",
93+
"git-hooks": "git-hooks",
94+
"nixpkgs": "nixpkgs",
95+
"pre-commit-hooks": [
96+
"git-hooks"
97+
]
98+
}
99+
}
100+
},
101+
"root": "root",
102+
"version": 7
103+
}

devenv.nix

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
pkgs,
3+
lib,
4+
config,
5+
inputs,
6+
...
7+
}:
8+
9+
{
10+
# https://devenv.sh/basics/
11+
env.GREET = "devenv";
12+
13+
# https://devenv.sh/packages/
14+
packages = [ pkgs.git ];
15+
16+
# https://devenv.sh/languages/
17+
# languages.rust.enable = true;
18+
languages.elixir.enable = true;
19+
20+
# https://devenv.sh/processes/
21+
# processes.cargo-watch.exec = "cargo-watch";
22+
23+
# https://devenv.sh/services/
24+
# services.postgres.enable = true;
25+
26+
# https://devenv.sh/scripts/
27+
scripts.hello.exec = ''
28+
echo hello from $GREET
29+
'';
30+
31+
enterShell = ''
32+
hello
33+
git --version
34+
'';
35+
36+
# https://devenv.sh/tasks/
37+
# tasks = {
38+
# "myproj:setup".exec = "mytool build";
39+
# "devenv:enterShell".after = [ "myproj:setup" ];
40+
# };
41+
42+
# https://devenv.sh/tests/
43+
enterTest = ''
44+
echo "Running tests"
45+
git --version | grep --color=auto "${pkgs.git.version}"
46+
'';
47+
48+
# https://devenv.sh/git-hooks/
49+
# git-hooks.hooks.shellcheck.enable = true;
50+
51+
# See full reference at https://devenv.sh/reference/options/
52+
}

devenv.yaml

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

0 commit comments

Comments
 (0)