2023-12-23 15:07:17 +00:00
|
|
|
{
|
|
|
|
description = "A rust crate used to generate multi-language apis for your
|
|
|
|
application";
|
|
|
|
inputs = {
|
2023-12-23 17:35:38 +00:00
|
|
|
# nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
nixpkgs.url = "github:soispha/nixpkgs/licensure";
|
2023-12-23 15:07:17 +00:00
|
|
|
|
|
|
|
# inputs for following
|
|
|
|
flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
crane = {
|
|
|
|
url = "github:ipetkov/crane";
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
flake-utils = {
|
|
|
|
url = "github:numtide/flake-utils";
|
|
|
|
inputs = {};
|
|
|
|
};
|
|
|
|
rust-overlay = {
|
|
|
|
url = "github:oxalica/rust-overlay";
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.follows = "nixpkgs";
|
|
|
|
flake-utils.follows = "flake-utils";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
ebnf2pdf = {
|
|
|
|
url = "git+https://codeberg.org/soispha/ebnf2pdf.git";
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.follows = "nixpkgs";
|
|
|
|
flake-utils.follows = "flake-utils";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
outputs = {
|
|
|
|
nixpkgs,
|
|
|
|
crane,
|
|
|
|
flake-utils,
|
|
|
|
rust-overlay,
|
2023-12-23 17:35:38 +00:00
|
|
|
ebnf2pdf,
|
2023-12-23 15:07:17 +00:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
flake-utils.lib.eachDefaultSystem (system: let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [(import rust-overlay)];
|
|
|
|
};
|
|
|
|
|
|
|
|
nightly = false;
|
|
|
|
rust =
|
|
|
|
if nightly
|
|
|
|
then
|
|
|
|
(pkgs.rust-bin.selectLatestNightlyWith (toolchain:
|
|
|
|
toolchain.default))
|
|
|
|
.override {
|
|
|
|
extensions = ["rustc-codegen-cranelift-preview"];
|
|
|
|
}
|
|
|
|
else pkgs.rust-bin.stable.latest.default;
|
|
|
|
rust_min =
|
|
|
|
if nightly
|
|
|
|
then
|
|
|
|
(pkgs.rust-bin.selectLatestNightlyWith (toolchain:
|
|
|
|
toolchain.minimal))
|
|
|
|
.override {
|
|
|
|
extensions = ["rustc-codegen-cranelift-preview"];
|
|
|
|
}
|
|
|
|
else pkgs.rust-bin.stable.latest.minimal;
|
|
|
|
|
|
|
|
craneLib = (crane.mkLib pkgs).overrideToolchain rust_min;
|
|
|
|
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
lua54Packages.lua
|
|
|
|
];
|
|
|
|
|
|
|
|
craneBuild = craneLib.buildPackage {
|
|
|
|
src = craneLib.cleanCargoSource ./.;
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
inherit nativeBuildInputs buildInputs;
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
checks.default = craneBuild;
|
|
|
|
packages = {
|
|
|
|
default = craneBuild;
|
|
|
|
};
|
|
|
|
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
packages = with pkgs; [
|
|
|
|
alejandra
|
|
|
|
|
2023-12-23 17:35:38 +00:00
|
|
|
cocogitto
|
|
|
|
licensure
|
|
|
|
|
2023-12-23 15:07:17 +00:00
|
|
|
rust
|
|
|
|
cargo-edit
|
|
|
|
cargo-expand
|
|
|
|
|
|
|
|
ebnf2pdf.outputs.packages."${system}".default
|
|
|
|
];
|
|
|
|
inherit nativeBuildInputs buildInputs;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|