cartographer/flake.nix

59 lines
1.4 KiB
Nix
Raw Normal View History

2024-09-11 01:34:47 -07:00
{
description = "A TUI for the Canvas LMS.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
naersk.url = "github:nix-community/naersk";
2024-09-11 01:34:47 -07:00
};
outputs =
{
nixpkgs,
flake-utils,
rust-overlay,
naersk,
2024-09-11 01:34:47 -07:00
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
naersk' = pkgs.callPackage naersk { };
defaultBuildOpts = {
cargo = pkgs.rust-bin.stable.latest.default;
rustc = pkgs.rust-bin.stable.latest.default;
src = ./.;
nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [ openssl ];
mode = "build";
};
2024-09-11 01:34:47 -07:00
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
2024-09-11 01:34:47 -07:00
pkg-config
rust-bin.stable.latest.rust-analyzer
2024-09-11 01:34:47 -07:00
rust-bin.stable.latest.default
openssl
rust-bin.stable.latest.rustfmt
2024-09-11 01:34:47 -07:00
];
};
packages = {
default = naersk'.buildPackage defaultBuildOpts;
test = naersk'.buildPackage (
defaultBuildOpts
// {
mode = "test";
}
);
2024-09-11 01:34:47 -07:00
};
}
);
}