Skip to content

Commit 8553cbc

Browse files
committed
Add devenv support
1 parent 31d160b commit 8553cbc

File tree

5 files changed

+189
-0
lines changed

5 files changed

+189
-0
lines changed

.envrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0="
2+
3+
use devenv

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,12 @@ testbin/
2424

2525
# Docs
2626
site/
27+
# Devenv
28+
.devenv*
29+
devenv.local.nix
30+
31+
# direnv
32+
.direnv
33+
34+
# pre-commit
35+
.pre-commit-config.yaml

devenv.lock

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
"nodes": {
3+
"devenv": {
4+
"locked": {
5+
"dir": "src/modules",
6+
"lastModified": 1721213664,
7+
"owner": "cachix",
8+
"repo": "devenv",
9+
"rev": "1d848fc26376d919458482fa0b4d0e240285a93f",
10+
"treeHash": "cd2f7b659c9730ae8a0604d47237ee6928ae4d07",
11+
"type": "github"
12+
},
13+
"original": {
14+
"dir": "src/modules",
15+
"owner": "cachix",
16+
"repo": "devenv",
17+
"type": "github"
18+
}
19+
},
20+
"flake-compat": {
21+
"flake": false,
22+
"locked": {
23+
"lastModified": 1696426674,
24+
"owner": "edolstra",
25+
"repo": "flake-compat",
26+
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
27+
"treeHash": "2addb7b71a20a25ea74feeaf5c2f6a6b30898ecb",
28+
"type": "github"
29+
},
30+
"original": {
31+
"owner": "edolstra",
32+
"repo": "flake-compat",
33+
"type": "github"
34+
}
35+
},
36+
"gitignore": {
37+
"inputs": {
38+
"nixpkgs": [
39+
"pre-commit-hooks",
40+
"nixpkgs"
41+
]
42+
},
43+
"locked": {
44+
"lastModified": 1709087332,
45+
"owner": "hercules-ci",
46+
"repo": "gitignore.nix",
47+
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
48+
"treeHash": "ca14199cabdfe1a06a7b1654c76ed49100a689f9",
49+
"type": "github"
50+
},
51+
"original": {
52+
"owner": "hercules-ci",
53+
"repo": "gitignore.nix",
54+
"type": "github"
55+
}
56+
},
57+
"nixpkgs": {
58+
"locked": {
59+
"lastModified": 1716977621,
60+
"owner": "cachix",
61+
"repo": "devenv-nixpkgs",
62+
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
63+
"treeHash": "6d9f1f7ca0faf1bc2eeb397c78a49623260d3412",
64+
"type": "github"
65+
},
66+
"original": {
67+
"owner": "cachix",
68+
"ref": "rolling",
69+
"repo": "devenv-nixpkgs",
70+
"type": "github"
71+
}
72+
},
73+
"nixpkgs-stable": {
74+
"locked": {
75+
"lastModified": 1721226092,
76+
"owner": "NixOS",
77+
"repo": "nixpkgs",
78+
"rev": "c716603a63aca44f39bef1986c13402167450e0a",
79+
"treeHash": "0d48af618426f14a604c2fa720128ba5f37e72eb",
80+
"type": "github"
81+
},
82+
"original": {
83+
"owner": "NixOS",
84+
"ref": "nixos-24.05",
85+
"repo": "nixpkgs",
86+
"type": "github"
87+
}
88+
},
89+
"pre-commit-hooks": {
90+
"inputs": {
91+
"flake-compat": "flake-compat",
92+
"gitignore": "gitignore",
93+
"nixpkgs": [
94+
"nixpkgs"
95+
],
96+
"nixpkgs-stable": "nixpkgs-stable"
97+
},
98+
"locked": {
99+
"lastModified": 1721042469,
100+
"owner": "cachix",
101+
"repo": "pre-commit-hooks.nix",
102+
"rev": "f451c19376071a90d8c58ab1a953c6e9840527fd",
103+
"treeHash": "91f40b7a3b9f6886bd77482cba5b5cd890415a2e",
104+
"type": "github"
105+
},
106+
"original": {
107+
"owner": "cachix",
108+
"repo": "pre-commit-hooks.nix",
109+
"type": "github"
110+
}
111+
},
112+
"root": {
113+
"inputs": {
114+
"devenv": "devenv",
115+
"nixpkgs": "nixpkgs",
116+
"pre-commit-hooks": "pre-commit-hooks"
117+
}
118+
}
119+
},
120+
"root": "root",
121+
"version": 7
122+
}

devenv.nix

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{ pkgs, lib, config, inputs, ... }:
2+
3+
{
4+
# https://devenv.sh/basics/
5+
env.GREET = "Flux2 dev env";
6+
7+
# https://devenv.sh/packages/
8+
packages = [
9+
pkgs.git
10+
pkgs.kustomize
11+
];
12+
13+
# https://devenv.sh/scripts/
14+
scripts.hello.exec = "echo Hello in the $GREET";
15+
scripts.tests.exec = "make test";
16+
17+
enterShell = ''
18+
hello
19+
'';
20+
21+
# https://devenv.sh/tests/
22+
enterTest = ''
23+
tests
24+
'';
25+
26+
# https://devenv.sh/services/
27+
# services.postgres.enable = true;
28+
29+
# https://devenv.sh/languages/
30+
# languages.nix.enable = true;
31+
languages.go.enable = true;
32+
33+
# https://devenv.sh/pre-commit-hooks/
34+
# pre-commit.hooks.shellcheck.enable = true;
35+
36+
# https://devenv.sh/processes/
37+
# processes.ping.exec = "ping example.com";
38+
39+
# See full reference at https://devenv.sh/reference/options/
40+
}

devenv.yaml

+15
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)