cartographer/flake.nix

58 lines
1.4 KiB
Nix

{
description = "A TUI for the Canvas LMS.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
naersk.url = "github:nix-community/naersk";
};
outputs =
{
nixpkgs,
flake-utils,
fenix,
naersk,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
naersk' = pkgs.callPackage naersk { };
defaultBuildOpts = {
cargo = fenix.packages.${system}.stable.cargo;
rustc = fenix.packages.${system}.stable.rustc;
src = ./.;
nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [ openssl ];
mode = "build";
};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
pkg-config
openssl
fenix.packages.${system}.stable.completeToolchain
cargo-audit
];
};
packages = {
default = naersk'.buildPackage defaultBuildOpts;
test = naersk'.buildPackage (
defaultBuildOpts
// {
mode = "test";
}
);
};
}
);
}