|
|
@ -2,38 +2,66 @@
|
|
|
|
inputs = {
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs";
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs";
|
|
|
|
utils.url = "github:numtide/flake-utils";
|
|
|
|
utils.url = "github:numtide/flake-utils";
|
|
|
|
naersk.url = "github:nix-community/naersk";
|
|
|
|
naersk = {
|
|
|
|
|
|
|
|
url = "github:nix-community/naersk";
|
|
|
|
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
fenix = {
|
|
|
|
|
|
|
|
url = "github:nix-community/fenix";
|
|
|
|
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, utils, naersk }:
|
|
|
|
outputs = {
|
|
|
|
utils.lib.eachDefaultSystem (system:
|
|
|
|
self,
|
|
|
|
let
|
|
|
|
nixpkgs,
|
|
|
|
pkgs = nixpkgs.legacyPackages."${system}";
|
|
|
|
utils,
|
|
|
|
naersk-lib = naersk.lib."${system}";
|
|
|
|
naersk,
|
|
|
|
in rec
|
|
|
|
fenix,
|
|
|
|
{
|
|
|
|
...
|
|
|
|
packages.jade = naersk-lib.buildPackage {
|
|
|
|
}:
|
|
|
|
pname = "jade";
|
|
|
|
utils.lib.eachDefaultSystem (system: let
|
|
|
|
root = ./.;
|
|
|
|
pkgs = nixpkgs.legacyPackages."${system}";
|
|
|
|
};
|
|
|
|
toolchain = with fenix.packages."${system}";
|
|
|
|
|
|
|
|
combine [
|
|
|
|
packages.default = packages.jade;
|
|
|
|
latest.rustc
|
|
|
|
|
|
|
|
latest.cargo
|
|
|
|
|
|
|
|
latest.clippy
|
|
|
|
|
|
|
|
latest.rustfmt
|
|
|
|
|
|
|
|
latest.rust-analyzer
|
|
|
|
|
|
|
|
latest.rust-src
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
naersk-lib = naersk.lib."${system}".override {
|
|
|
|
|
|
|
|
cargo = toolchain;
|
|
|
|
|
|
|
|
rustc = toolchain;
|
|
|
|
|
|
|
|
clippy = toolchain;
|
|
|
|
|
|
|
|
rustfmt = toolchain;
|
|
|
|
|
|
|
|
rust-analyzer = toolchain;
|
|
|
|
|
|
|
|
rust-src = toolchain;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
in rec
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
packages.jade = naersk-lib.buildPackage {
|
|
|
|
|
|
|
|
pname = "Jade";
|
|
|
|
|
|
|
|
root = ./.;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
apps.jade = utils.lib.mkApp {
|
|
|
|
packages.default = packages.jade;
|
|
|
|
drv = packages.jade;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
apps.default = apps.jade;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
apps.jade = utils.lib.mkApp {
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
drv = packages.jade;
|
|
|
|
rustc
|
|
|
|
};
|
|
|
|
cargo
|
|
|
|
|
|
|
|
rustfmt
|
|
|
|
apps.default = apps.jade;
|
|
|
|
cargo-audit
|
|
|
|
|
|
|
|
clippy
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
|
|
|
toolchain
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
# For rust-analyzer
|
|
|
|
|
|
|
|
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
formatter = pkgs.alejandra;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|