eagle/flake.nix

54 lines
1.9 KiB
Nix
Raw Normal View History

2024-06-19 23:25:45 +02:00
{
inputs = {
2024-06-21 12:35:45 +02:00
naersk.url = "github:nix-community/naersk/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
utils.url = "github:numtide/flake-utils";
2024-06-19 23:25:45 +02:00
};
2024-06-21 12:35:45 +02:00
outputs = { self, nixpkgs, rust-overlay, utils, naersk }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
2024-06-19 23:25:45 +02:00
2024-06-21 12:35:45 +02:00
naersk-lib = pkgs.callPackage naersk {};
in
{
packages = {
default = naersk-lib.buildPackage {
src = ./.;
doCheck = true;
2024-06-23 01:50:36 +02:00
mode = "test";
};
unix = naersk-lib.buildPackage {
src = ./.;
doCheck = true;
2024-06-22 13:00:56 +02:00
cargoBuildOptions = x: x ++ ["--no-default-features" "--features" "unix"];
cargoTestOptions = x: x ++ ["--no-default-features" "--features" "unix"];
2024-06-23 01:50:36 +02:00
mode = "test";
};
tcp = naersk-lib.buildPackage {
src = ./.;
doCheck = true;
2024-06-22 13:00:56 +02:00
cargoBuildOptions = x: x ++ ["--no-default-features" "--features" "tcp"];
cargoTestOptions = x: x ++ ["--no-default-features" "--features" "tcp"];
2024-06-23 01:50:36 +02:00
mode = "test";
};
clippy_unix = naersk-lib.buildPackage {
src = ./.;
cargoBuildOptions = x: x ++ ["--no-default-features" "--features" "unix"];
cargoTestOptions = x: x ++ ["--no-default-features" "--features" "unix"];
mode = "clippy";
};
clippy_tcp = naersk-lib.buildPackage {
src = ./.;
cargoBuildOptions = x: x ++ ["--no-default-features" "--features" "tcp"];
cargoTestOptions = x: x ++ ["--no-default-features" "--features" "tcp"];
mode = "clippy";
};
};
2024-06-21 12:35:45 +02:00
devShell = with pkgs; mkShell {
2024-06-21 15:54:48 +02:00
nativeBuildInputs = with pkgs; [rustc cargo rustfmt pre-commit clippy cargo-expand];
2024-06-21 12:35:45 +02:00
};
2024-06-19 23:25:45 +02:00
});
2024-06-21 12:35:45 +02:00
}