Initial commit
Signed-off-by: Val Packett <val@invisiblethingslab.com>
This commit is contained in:
commit
11a682e19f
12 changed files with 180 additions and 0 deletions
44
flake.nix
Normal file
44
flake.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
|
||||
flake-utils.lib.eachDefaultSystem
|
||||
(system:
|
||||
let
|
||||
overlays = [ (import rust-overlay) ];
|
||||
pkgs = import nixpkgs {
|
||||
inherit system overlays;
|
||||
};
|
||||
|
||||
rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
rustPlatform = pkgs.makeRustPlatform {
|
||||
cargo = rustToolchain;
|
||||
rustc = rustToolchain;
|
||||
};
|
||||
rustPackage = crate:
|
||||
let cargoToml = builtins.fromTOML (builtins.readFile ./${crate}/Cargo.toml);
|
||||
in rustPlatform.buildRustPackage {
|
||||
inherit (cargoToml.package) name version;
|
||||
src = ./${crate};
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
# buildFeatures = features;
|
||||
# buildInputs = runtimeDeps;
|
||||
# nativeBuildInputs = buildDeps;
|
||||
};
|
||||
in
|
||||
{
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = [ rustToolchain ];
|
||||
};
|
||||
|
||||
packages.sidebus-broker = rustPackage "sidebus-broker";
|
||||
}
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue