-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added nix flake for developer convenience (#2)
- Loading branch information
Showing
4 changed files
with
116 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
*.egg-info/ | ||
*.DS_Store | ||
|
||
target/ | ||
*.egg-info/ | ||
.direnv/ | ||
.docker_image_built | ||
.envrc | ||
__pycache__/ | ||
nanopb | ||
nanopb_out/ | ||
.docker_image_built | ||
|
||
# generated | ||
out.bin | ||
|
||
nanopb | ||
target/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
description = "orb-mcu-messaging flake"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; | ||
# Provides eachDefaultSystem and other utility functions | ||
utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, utils }: | ||
|
||
# This helper function is used to more easily abstract | ||
# over the host platform. | ||
# See https://github.com/numtide/flake-utils#eachdefaultsystem--system---attrs | ||
utils.lib.eachDefaultSystem (system: | ||
let | ||
p = { | ||
# The platform that you are running nix on and building from | ||
native = nixpkgs.legacyPackages.${system}; | ||
}; | ||
in | ||
{ | ||
# Everything in here becomes your shell (nix develop) | ||
devShells.default = p.native.mkShell { | ||
# Nix makes the following list of dependencies available to the development | ||
# environment. | ||
buildInputs = (with p.native; [ | ||
protobuf | ||
nixpkgs-fmt | ||
|
||
# This is missing on mac m1 nix, for some reason. | ||
# see https://stackoverflow.com/a/69732679 | ||
libiconv | ||
]); | ||
|
||
# The following sets up environment variables for the shell. These are used | ||
# by the build.rs build scripts of the rust crates. | ||
shellHook = '' | ||
# Env vars here | ||
''; | ||
}; | ||
# Lets you type `nix fmt` to format the flake. | ||
formatter = p.native.nixpkgs-fmt; | ||
} | ||
|
||
); | ||
|
||
} |