this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

build: iterate on the flake

+9 -10
+9 -10
flake.nix
··· 67 67 # Use the toolchain with the crane helper functions 68 68 craneLib = (inputs.crane.mkLib pkgs).overrideToolchain toolChain; 69 69 70 - # Clean the src to only have the Rust-relevant files 71 - src = craneLib.cleanCargoSource (craneLib.path ./.); 72 - 73 70 # Common arguments for mkCargoDerivation, a helper for the crane functions 74 71 # Arguments can be included here even if they aren't used, but we only 75 72 # place them here if they would otherwise show up in multiple places 76 73 commonArgs = { 77 - inherit src cargoArtifacts; 78 - meta.mainProgram = "cmprss"; 74 + inherit cargoArtifacts; 75 + # Clean the src to only have the Rust-relevant files 76 + src = craneLib.cleanCargoSource ./.; 77 + strictDeps = true; 79 78 }; 80 79 81 80 # Build only the cargo dependencies so we can cache them all when running in CI 82 81 cargoArtifacts = craneLib.buildDepsOnly commonArgs; 83 82 84 83 # Build the actual crate itself, reusing the cargoArtifacts 85 - cmprss = craneLib.buildPackage commonArgs; 84 + cmprss = craneLib.buildPackage (commonArgs // {meta.mainProgram = "cmprss";}); 86 85 in { 87 86 checks = { 88 87 # Build the crate as part of `nix flake check` for convenience ··· 105 104 nextest = craneLib.cargoNextest commonArgs; 106 105 }; 107 106 107 + # This also sets up `nix fmt` to run all formatters 108 108 treefmt = { 109 109 projectRootFile = ./flake.nix; 110 110 programs = { ··· 153 153 ''; 154 154 155 155 # Include the packages from the defined checks and packages 156 + # Installs the full cargo toolchain and the extra tools, e.g. cargo-tarpaulin. 156 157 inputsFrom = 157 158 (builtins.attrValues self.checks.${system}) 158 159 ++ (builtins.attrValues self.packages.${system}); 159 160 160 161 # Extra inputs can be added here 161 - nativeBuildInputs = with pkgs; [ 162 + packages = with pkgs; [ 162 163 act # For running Github Actions locally 163 164 alejandra 164 165 deadnix ··· 168 169 nodePackages.prettier 169 170 statix 170 171 171 - # Code coverage 172 - cargo-tarpaulin 173 - 174 172 # For running tests 175 173 diffutils 174 + 176 175 # Official tools 177 176 bzip2 178 177 gnutar