Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Nix flake
Browse files Browse the repository at this point in the history
this will allow folks to run moccasin using
`nix run github:rektdeckard/moccasin`, as well as integrate it to their
Nix configs otherwise.
nbsp committed Nov 24, 2024
1 parent a2832ff commit 74de94a
Showing 5 changed files with 136 additions and 0 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target
.direnv
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -32,6 +32,10 @@ cd /usr/pkgsrc/news/moccasin
make install
```

### Nix

moccasin is available as a Nix flake: `github:rektdeckard/moccasin`.

## Usage

Since "moccasin" is hard to spell and has too many letters, the executable is just called `mcsn`.
93 changes: 93 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
};

outputs =
{
self,
flake-utils,
naersk,
nixpkgs,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = (import nixpkgs) { inherit system; };
naersk' = pkgs.callPackage naersk { };
in
{
# For `nix build` & `nix run`:
defaultPackage = naersk'.buildPackage { src = ./.; };

# For `nix develop`:
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
rustc
cargo
rust-analyzer
clippy
rustfmt
];
};
}
);
}

0 comments on commit 74de94a

Please sign in to comment.