Skip to content

Commit 06ff4b7

Browse files
committed
Add devenv.nix
Must have only Nix and devenv installed ``` devenv shell cargo build sudo ./target/debug/framework_tool ``` Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent c2beb78 commit 06ff4b7

File tree

6 files changed

+188
-0
lines changed

6 files changed

+188
-0
lines changed

.envrc

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

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,15 @@ build/
44
*.efi
55
*.exe
66
*.pdb
7+
8+
# Devenv
9+
.devenv*
10+
devenv.local.nix
11+
# Nix
12+
result*
13+
14+
# direnv
15+
.direnv
16+
17+
# pre-commit
18+
.pre-commit-config.yaml

devenv.lock

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

devenv.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{ pkgs, lib, config, inputs, ... }:
2+
3+
{
4+
packages = with pkgs; [
5+
systemd # libudev
6+
];
7+
8+
languages.rust.enable = true;
9+
# https://devenv.sh/reference/options/#languagesrustchannel
10+
languages.rust.channel = "stable";
11+
}

devenv.yaml

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

nix.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Building with Nix
2+
3+
## Building with devenv
4+
5+
6+
Must have Nix and devenv installed
7+
8+
```
9+
devenv shell
10+
cargo build
11+
sudo ./target/debug/framework_tool
12+
```

0 commit comments

Comments
 (0)