Skip to content

Commit 8ee1312

Browse files
committed
chore: setup devenv environment for development
1 parent 56f20ea commit 8ee1312

7 files changed

Lines changed: 243 additions & 0 deletions

File tree

.Rbuildignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@
3232
^extras$
3333
^paper$
3434
^\.task$
35+
^\.direnv$
36+
^\.devenv$
37+
^\.envrc$
38+
^\devenv.lock$
39+
^\devenv.nix$
40+
^\devenv.yaml$

.envrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export DIRENV_WARN_TIMEOUT=20s
2+
3+
eval "$(devenv direnvrc)"
4+
5+
use devenv
6+
use vim

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,14 @@ target
3838
# latexindent
3939
indent.log
4040
.task/
41+
42+
# Devenv
43+
.devenv*
44+
devenv.local.nix
45+
devenv.local.yaml
46+
47+
# direnv
48+
.direnv
49+
50+
# pre-commit
51+
.pre-commit-config.yaml

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ To contribute to `caugi`, you'll need:
3232
2. **Rust toolchain** - See the DESCRIPTION file for minimum version requirements and system dependencies
3333
3. **Development tools** - Install the package using `pak::pak("frederikfabriciusbjerre/caugi")` which will handle all dependencies
3434

35+
Alternatively, you can also use the [devenv](https://devenv.sh) configuration
36+
provided in the repository for a consistent development environment.
37+
3538
### Installing Rust
3639

3740
If you don't have Rust installed, visit [rustup.rs](https://rustup.rs/) for installation instructions appropriate for your platform.

devenv.lock

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
{
2+
"nodes": {
3+
"devenv": {
4+
"locked": {
5+
"dir": "src/modules",
6+
"lastModified": 1775507677,
7+
"narHash": "sha256-gCv9ODisrHjTDtjV/Xru8dtDbrldahRZFShu089/60M=",
8+
"owner": "cachix",
9+
"repo": "devenv",
10+
"rev": "c429c111e25b467c431f9eb70598c70394d56aaa",
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": 1767039857,
24+
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
25+
"owner": "NixOS",
26+
"repo": "flake-compat",
27+
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
28+
"type": "github"
29+
},
30+
"original": {
31+
"owner": "NixOS",
32+
"repo": "flake-compat",
33+
"type": "github"
34+
}
35+
},
36+
"git-hooks": {
37+
"inputs": {
38+
"flake-compat": "flake-compat",
39+
"gitignore": "gitignore",
40+
"nixpkgs": [
41+
"nixpkgs"
42+
]
43+
},
44+
"locked": {
45+
"lastModified": 1775036584,
46+
"narHash": "sha256-zW0lyy7ZNNT/x8JhzFHBsP2IPx7ATZIPai4FJj12BgU=",
47+
"owner": "cachix",
48+
"repo": "git-hooks.nix",
49+
"rev": "4e0eb042b67d863b1b34b3f64d52ceb9cd926735",
50+
"type": "github"
51+
},
52+
"original": {
53+
"owner": "cachix",
54+
"repo": "git-hooks.nix",
55+
"type": "github"
56+
}
57+
},
58+
"gitignore": {
59+
"inputs": {
60+
"nixpkgs": [
61+
"git-hooks",
62+
"nixpkgs"
63+
]
64+
},
65+
"locked": {
66+
"lastModified": 1709087332,
67+
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
68+
"owner": "hercules-ci",
69+
"repo": "gitignore.nix",
70+
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
71+
"type": "github"
72+
},
73+
"original": {
74+
"owner": "hercules-ci",
75+
"repo": "gitignore.nix",
76+
"type": "github"
77+
}
78+
},
79+
"nixpkgs": {
80+
"inputs": {
81+
"nixpkgs-src": "nixpkgs-src"
82+
},
83+
"locked": {
84+
"lastModified": 1774287239,
85+
"narHash": "sha256-W3krsWcDwYuA3gPWsFA24YAXxOFUL6iIlT6IknAoNSE=",
86+
"owner": "cachix",
87+
"repo": "devenv-nixpkgs",
88+
"rev": "fa7125ea7f1ae5430010a6e071f68375a39bd24c",
89+
"type": "github"
90+
},
91+
"original": {
92+
"owner": "cachix",
93+
"ref": "rolling",
94+
"repo": "devenv-nixpkgs",
95+
"type": "github"
96+
}
97+
},
98+
"nixpkgs-src": {
99+
"flake": false,
100+
"locked": {
101+
"lastModified": 1773840656,
102+
"narHash": "sha256-9tpvMGFteZnd3gRQZFlRCohVpqooygFuy9yjuyRL2C0=",
103+
"owner": "NixOS",
104+
"repo": "nixpkgs",
105+
"rev": "9cf7092bdd603554bd8b63c216e8943cf9b12512",
106+
"type": "github"
107+
},
108+
"original": {
109+
"owner": "NixOS",
110+
"ref": "nixpkgs-unstable",
111+
"repo": "nixpkgs",
112+
"type": "github"
113+
}
114+
},
115+
"root": {
116+
"inputs": {
117+
"devenv": "devenv",
118+
"git-hooks": "git-hooks",
119+
"nixpkgs": "nixpkgs"
120+
}
121+
}
122+
},
123+
"root": "root",
124+
"version": 7
125+
}

devenv.nix

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
pkgs,
3+
...
4+
}:
5+
6+
{
7+
packages = [
8+
pkgs.air-formatter
9+
pkgs.bashInteractive
10+
pkgs.cargo-audit
11+
pkgs.cargo-deny
12+
pkgs.cargo-flamegraph
13+
pkgs.cargo-llvm-cov
14+
pkgs.go-task
15+
pkgs.jarl
16+
pkgs.llvmPackages.bintools
17+
];
18+
19+
languages = {
20+
rust = {
21+
enable = true;
22+
};
23+
24+
r = {
25+
enable = true;
26+
27+
package = (
28+
pkgs.rWrapper.override {
29+
packages = with pkgs.rPackages; [
30+
bench
31+
bnlearn
32+
dagitty
33+
data_table
34+
devtools
35+
dplyr
36+
fastmap
37+
ggbeeswarm
38+
ggm
39+
graph
40+
gRbase
41+
gridExtra
42+
igraph
43+
jsonlite
44+
knitr
45+
MASS
46+
Matrix
47+
pcalg
48+
processx
49+
rextendr
50+
rhub
51+
rlang
52+
rmarkdown
53+
S7
54+
spelling
55+
testthat
56+
tidyverse
57+
urlchecker
58+
usethis
59+
waldo
60+
withr
61+
];
62+
}
63+
);
64+
65+
lsp.enable = true;
66+
};
67+
};
68+
69+
git-hooks = {
70+
hooks = {
71+
clippy = {
72+
enable = true;
73+
74+
settings = {
75+
allFeatures = true;
76+
};
77+
};
78+
79+
rustfmt = {
80+
enable = true;
81+
};
82+
};
83+
};
84+
}

devenv.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
inputs:
2+
git-hooks:
3+
url: github:cachix/git-hooks.nix
4+
inputs:
5+
nixpkgs:
6+
follows: nixpkgs
7+
nixpkgs:
8+
url: github:cachix/devenv-nixpkgs/rolling

0 commit comments

Comments
 (0)