Skip to content

Commit

Permalink
chore: Add nix flakes support (#751)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucioFranco authored Nov 9, 2022
1 parent 10c507c commit 7ea0789
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,13 @@ pub enum Gender {
}
```

## Nix

The prost project maintains flakes support for local development. Once you have
nix and nix flakes setup you can just run `nix develop` to get a shell
configured with the required dependencies to compile the whole project.


## FAQ

1. **Could `prost` be implemented as a serializer for [Serde](https://serde.rs/)?**
Expand Down
43 changes: 43 additions & 0 deletions flake.lock

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

20 changes: 20 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
description = "Prost dependencies";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [ cargo rustc ];
buildInputs = with pkgs; [ pkg-config protobuf curl ];
};
});
}

0 comments on commit 7ea0789

Please sign in to comment.