Skip to content

Commit 950f383

Browse files
Add devenv configuration (#629)
1 parent 9fb4e5a commit 950f383

File tree

6 files changed

+219
-0
lines changed

6 files changed

+219
-0
lines changed

.envrc

Lines changed: 3 additions & 0 deletions
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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,12 @@
1010
/spec/unit/.lib
1111
/tmp
1212
/docs/*.html
13+
# Devenv
14+
.devenv*
15+
devenv.local.nix
16+
17+
# direnv
18+
.direnv
19+
20+
# pre-commit
21+
.pre-commit-config.yaml

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,19 @@ Run `make test` to run the test suites:
107107

108108
Run `make docs` to build the manpages.
109109

110+
### Devenv
111+
112+
This repository contains a configuration for [devenv.sh](https://devenv.sh) which
113+
makes it easy to setup a reproducible environment with all necessary tools for
114+
building and testing.
115+
116+
- Checkout the repository
117+
- Run `devenv shell` to get a shell with development environment
118+
119+
A hook for [automatic shell activation](https://devenv.sh/automatic-shell-activation/)
120+
is also included. If you have `direnv` installed, the devenv environment loads
121+
automatically upon entering the repo folder.
122+
110123
## License
111124

112125
Licensed under the Apache License, Version 2.0. See [LICENSE](./LICENSE) for

devenv.lock

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
{
2+
"nodes": {
3+
"devenv": {
4+
"locked": {
5+
"dir": "src/modules",
6+
"lastModified": 1713968789,
7+
"owner": "cachix",
8+
"repo": "devenv",
9+
"rev": "b26b52a4dac68bdc305f6b9df948c97f49b2c3ee",
10+
"treeHash": "4a034bbd3511c196f4075a1eb0da1b422d1011db",
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+
"flake-utils": {
37+
"inputs": {
38+
"systems": "systems"
39+
},
40+
"locked": {
41+
"lastModified": 1710146030,
42+
"owner": "numtide",
43+
"repo": "flake-utils",
44+
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
45+
"treeHash": "bd263f021e345cb4a39d80c126ab650bebc3c10c",
46+
"type": "github"
47+
},
48+
"original": {
49+
"owner": "numtide",
50+
"repo": "flake-utils",
51+
"type": "github"
52+
}
53+
},
54+
"gitignore": {
55+
"inputs": {
56+
"nixpkgs": [
57+
"pre-commit-hooks",
58+
"nixpkgs"
59+
]
60+
},
61+
"locked": {
62+
"lastModified": 1709087332,
63+
"owner": "hercules-ci",
64+
"repo": "gitignore.nix",
65+
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
66+
"treeHash": "ca14199cabdfe1a06a7b1654c76ed49100a689f9",
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": 1713361204,
78+
"owner": "cachix",
79+
"repo": "devenv-nixpkgs",
80+
"rev": "285676e87ad9f0ca23d8714a6ab61e7e027020c6",
81+
"treeHash": "50354b35a3e0277d4a83a0a88fa0b0866b5f392f",
82+
"type": "github"
83+
},
84+
"original": {
85+
"owner": "cachix",
86+
"ref": "rolling",
87+
"repo": "devenv-nixpkgs",
88+
"type": "github"
89+
}
90+
},
91+
"nixpkgs-stable": {
92+
"locked": {
93+
"lastModified": 1713995372,
94+
"owner": "NixOS",
95+
"repo": "nixpkgs",
96+
"rev": "dd37924974b9202f8226ed5d74a252a9785aedf8",
97+
"treeHash": "8114bf8e19ad8c67c0e2639b83c606c58c7bccec",
98+
"type": "github"
99+
},
100+
"original": {
101+
"owner": "NixOS",
102+
"ref": "nixos-23.11",
103+
"repo": "nixpkgs",
104+
"type": "github"
105+
}
106+
},
107+
"pre-commit-hooks": {
108+
"inputs": {
109+
"flake-compat": "flake-compat",
110+
"flake-utils": "flake-utils",
111+
"gitignore": "gitignore",
112+
"nixpkgs": [
113+
"nixpkgs"
114+
],
115+
"nixpkgs-stable": "nixpkgs-stable"
116+
},
117+
"locked": {
118+
"lastModified": 1713954846,
119+
"owner": "cachix",
120+
"repo": "pre-commit-hooks.nix",
121+
"rev": "6fb82e44254d6a0ece014ec423cb62d92435336f",
122+
"treeHash": "a456512c8da29752b79131f1e5b45053e2394078",
123+
"type": "github"
124+
},
125+
"original": {
126+
"owner": "cachix",
127+
"repo": "pre-commit-hooks.nix",
128+
"type": "github"
129+
}
130+
},
131+
"root": {
132+
"inputs": {
133+
"devenv": "devenv",
134+
"nixpkgs": "nixpkgs",
135+
"pre-commit-hooks": "pre-commit-hooks"
136+
}
137+
},
138+
"systems": {
139+
"locked": {
140+
"lastModified": 1681028828,
141+
"owner": "nix-systems",
142+
"repo": "default",
143+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
144+
"treeHash": "cce81f2a0f0743b2eb61bc2eb6c7adbe2f2c6beb",
145+
"type": "github"
146+
},
147+
"original": {
148+
"owner": "nix-systems",
149+
"repo": "default",
150+
"type": "github"
151+
}
152+
}
153+
},
154+
"root": "root",
155+
"version": 7
156+
}

devenv.nix

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{ pkgs, lib, config, inputs, ... }:
2+
3+
{
4+
# https://devenv.sh/packages/
5+
packages = with pkgs; [
6+
# build deps
7+
gnumake
8+
asciidoctor
9+
10+
# test deps
11+
git
12+
fossil
13+
mercurial
14+
];
15+
enterShell = ''
16+
crystal --version
17+
'';
18+
19+
languages.crystal.enable = true;
20+
21+
# https://devenv.sh/pre-commit-hooks/
22+
pre-commit.hooks.shellcheck.enable = true;
23+
pre-commit.hooks.crystal.enable = true;
24+
}

devenv.yaml

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

0 commit comments

Comments
 (0)