jarr/flake.nix
2024-04-14 21:52:00 +01:00

54 lines
1.1 KiB
Nix

{
description = "java class file schenanigans in rust";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, crane, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
deps = with pkgs; [
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
pkgs.libiconv
];
craneLib = crane.lib.${system};
jarr = craneLib.buildPackage {
src = craneLib.cleanCargoSource (craneLib.path ./.);
buildInputs = deps;
};
in
{
checks = {
inherit jarr;
};
packages.default = jarr;
apps.default = flake-utils.lib.mkApp {
drv = jarr;
};
devShells.default = craneLib.devShell {
checks = self.checks.${system};
packages = with pkgs; [
rust-analyzer
jdk8
] ++ deps;
};
});
}