2022-06-27 19:28:22 -04:00
|
|
|
{
|
|
|
|
description = "IPFS deploy tool";
|
|
|
|
|
|
|
|
inputs = {
|
2022-12-03 22:49:32 -05:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/release-22.11";
|
2022-12-08 18:08:45 -05:00
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
|
|
|
|
fenix = {
|
|
|
|
url = "github:nix-community/fenix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
naersk = {
|
|
|
|
url = "github:nix-community/naersk";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2022-06-27 19:28:22 -04:00
|
|
|
};
|
|
|
|
|
2022-12-08 18:08:45 -05:00
|
|
|
outputs = { self, nixpkgs, flake-utils, fenix, naersk }:
|
|
|
|
flake-utils.lib.eachDefaultSystem (system:
|
2022-06-27 19:28:22 -04:00
|
|
|
let
|
|
|
|
pkgs = nixpkgs.legacyPackages."${system}";
|
|
|
|
|
2022-12-08 18:08:45 -05:00
|
|
|
mkToolchain = fenix.packages.${system}.combine;
|
|
|
|
toolchain = fenix.packages.${system}.stable;
|
|
|
|
|
|
|
|
buildToolchain = mkToolchain (with toolchain; [
|
|
|
|
cargo
|
|
|
|
rustc
|
|
|
|
]);
|
|
|
|
|
|
|
|
devToolchain = mkToolchain (with toolchain; [
|
|
|
|
cargo
|
|
|
|
clippy
|
|
|
|
rust-src
|
|
|
|
rustc
|
|
|
|
rust-analyzer
|
|
|
|
|
|
|
|
# Always use nightly rustfmt because most of its options are unstable
|
|
|
|
fenix.packages.${system}.latest.rustfmt
|
|
|
|
]);
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
packages.default = (pkgs.callPackage naersk {
|
|
|
|
cargo = buildToolchain;
|
|
|
|
rustc = buildToolchain;
|
|
|
|
}).buildPackage {
|
|
|
|
src = ./.;
|
2022-06-27 19:28:22 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
# `nix develop`
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
name = "marvin";
|
2022-12-08 18:08:45 -05:00
|
|
|
|
|
|
|
RUST_SRC_PATH = "${devToolchain}/lib/rustlib/src/rust/library";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ devToolchain pkgs.nixpkgs-fmt pkgs.libiconv ];
|
2022-06-27 19:28:22 -04:00
|
|
|
};
|
2022-12-08 18:08:45 -05:00
|
|
|
|
|
|
|
checks = {
|
|
|
|
packagesDefault = self.packages.${system}.default;
|
|
|
|
devShellsDefault = self.devShells.${system}.default;
|
|
|
|
};
|
|
|
|
|
2022-06-27 19:28:22 -04:00
|
|
|
});
|
|
|
|
}
|