{ description = "The autographer binary"; inputs = { nixpkgs.url = "nixpkgs/nixos-23.05"; flake-utils = { url = "github:numtide/flake-utils"; }; crane = { url = "github:ipetkov/crane"; inputs.nixpkgs.follows = "nixpkgs"; }; rust-overlay = { url = "github:oxalica/rust-overlay"; inputs = { nixpkgs.follows = "nixpkgs"; flake-utils.follows = "flake-utils"; }; }; }; outputs = inputs: inputs.flake-utils.lib.eachDefaultSystem (system: let pkgs = import inputs.nixpkgs { inherit system; overlays = [ (import inputs.rust-overlay) ]; }; rustTarget = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; craneLib = (inputs.crane.mkLib pkgs).overrideToolchain rustTarget; tomlInfo = craneLib.crateNameFromCargoToml { cargoToml = ./Cargo.toml; }; inherit (tomlInfo) pname version; src = ./.; cargoArtifacts = craneLib.buildDepsOnly { inherit src; cargoExtraArgs = "--all-features --all"; }; autographer = craneLib.buildPackage { inherit cargoArtifacts src version; cargoExtraArgs = "--all-features --all"; }; in rec { checks = { inherit autographer; autographer-clippy = craneLib.cargoClippy { inherit cargoArtifacts src; cargoExtraArgs = "--all --all-features"; cargoClippyExtraArgs = "-- --deny warnings"; }; autographer-fmt = craneLib.cargoFmt { inherit src; }; }; packages.autographer = autographer; packages.default = autographer; devShells.default = devShells.autographer; devShells.autographer = pkgs.mkShell { buildInputs = [ ]; nativeBuildInputs = [ rustTarget ]; }; } ); }