limbusart/flake.nix

52 lines
1.3 KiB
Nix
Raw Normal View History

2023-07-17 02:42:55 +03:00
{
description = "Build a cargo project without extra checks";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-07-17 02:42:55 +03:00
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, crane, flake-utils, rust-overlay, ... }:
2023-07-17 02:42:55 +03:00
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system}.appendOverlays [(import rust-overlay)];
2024-05-28 06:08:00 +03:00
craneLib = crane.mkLib pkgs;
2023-07-17 02:42:55 +03:00
my-crate = craneLib.buildPackage {
src = craneLib.cleanCargoSource (craneLib.path ./.);
};
in
{
checks = {
inherit my-crate;
};
packages.default = my-crate;
apps.default = flake-utils.lib.mkApp {
drv = my-crate;
};
devShells.default = pkgs.mkShell {
2023-07-17 09:01:10 +03:00
name = "limbusart-shell";
2023-07-17 02:42:55 +03:00
inputsFrom = builtins.attrValues self.checks.${system};
2023-07-17 09:01:10 +03:00
packages = with pkgs; [
2023-07-17 02:42:55 +03:00
cargo
(rust-bin.stable.latest.default.override {extensions = ["rust-src"];})
2023-07-17 02:42:55 +03:00
];
};
});
}