cartographer/flake.nix

58 lines
1.3 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";
2024-09-12 01:26:38 -07:00
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
naersk.url = "github:nix-community/naersk";
2024-09-11 01:34:47 -07:00
};
outputs =
{
nixpkgs,
flake-utils,
2024-09-12 01:26:38 -07:00
fenix,
naersk,
2024-09-11 01:34:47 -07:00
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
2024-09-12 01:26:38 -07:00
pkgs = import nixpkgs { inherit system; };
naersk' = pkgs.callPackage naersk { };
defaultBuildOpts = {
2024-09-12 01:26:38 -07:00
cargo = fenix.packages.${system}.stable.cargo;
rustc = fenix.packages.${system}.stable.rustc;
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
openssl
2024-09-12 01:26:38 -07:00
fenix.packages.${system}.stable.completeToolchain
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
};
}
);
}