Skip to content

Commit 95d2235

Browse files
nbsprektdeckard
authored andcommitted
add Nix flake
this will allow folks to run moccasin using `nix run github:rektdeckard/moccasin`, as well as integrate it to their Nix configs otherwise.
1 parent a2832ff commit 95d2235

File tree

5 files changed

+136
-0
lines changed

5 files changed

+136
-0
lines changed

.envrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/target
2+
.direnv

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ cd /usr/pkgsrc/news/moccasin
3232
make install
3333
```
3434

35+
### Nix
36+
37+
moccasin is available as a Nix flake: `github:rektdeckard/moccasin`.
38+
3539
## Usage
3640

3741
Since "moccasin" is hard to spell and has too many letters, the executable is just called `mcsn`.

flake.lock

+93
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
inputs = {
3+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
4+
flake-utils.url = "github:numtide/flake-utils";
5+
naersk.url = "github:nix-community/naersk";
6+
};
7+
8+
outputs =
9+
{
10+
self,
11+
flake-utils,
12+
naersk,
13+
nixpkgs,
14+
}:
15+
flake-utils.lib.eachDefaultSystem (
16+
system:
17+
let
18+
pkgs = (import nixpkgs) { inherit system; };
19+
naersk' = pkgs.callPackage naersk { };
20+
in
21+
{
22+
# For `nix build` & `nix run`:
23+
defaultPackage = naersk'.buildPackage { src = ./.; };
24+
25+
# For `nix develop`:
26+
devShell = pkgs.mkShell {
27+
nativeBuildInputs = with pkgs; [
28+
rustc
29+
cargo
30+
rust-analyzer
31+
clippy
32+
rustfmt
33+
];
34+
};
35+
}
36+
);
37+
}

0 commit comments

Comments
 (0)