Skip to content

Commit 8e4ba8f

Browse files
Patryk27Rahix
authored andcommitted
ravedude: Add flake.nix
1 parent d972669 commit 8e4ba8f

File tree

3 files changed

+108
-0
lines changed

3 files changed

+108
-0
lines changed

ravedude/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ Next, install the latest version from crates.io with the following command:
2424
cargo install ravedude
2525
```
2626

27+
(alternatively, if you're using NixOS + Flakes, you can install `ravedude` by
28+
adding `inputs.ravedude.url = "github:Rahix/avr-hal?dir=ravedude";` and then
29+
`environment.systemPackages = [ ravedude.defaultPackage."${system}" ];`.)
30+
2731
Now you need to add *ravedude* to your project. For example in a project for
2832
Arduino Uno, place the following into your `.cargo/config.toml` (**not in
2933
`Cargo.toml`**):

ravedude/flake.lock

Lines changed: 70 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ravedude/flake.nix

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
inputs = {
3+
utils = {
4+
url = "github:numtide/flake-utils";
5+
};
6+
7+
naersk = {
8+
url = "github:nix-community/naersk";
9+
};
10+
};
11+
12+
outputs = { self, nixpkgs, utils, naersk }:
13+
utils.lib.eachDefaultSystem (system:
14+
let
15+
pkgs = import nixpkgs {
16+
inherit system;
17+
};
18+
19+
naersk' = pkgs.callPackage naersk {};
20+
21+
in
22+
rec {
23+
defaultPackage = naersk'.buildPackage {
24+
pname = "ravedude";
25+
src = ./.;
26+
27+
buildInputs = with pkgs; [
28+
pkg-config
29+
udev
30+
];
31+
};
32+
}
33+
);
34+
}

0 commit comments

Comments
 (0)