From 23c016fb17fb5cb95b624e9edf9ec3a623516a79 Mon Sep 17 00:00:00 2001 From: "DavidCrompton1192@gmail.com" Date: Mon, 6 Mar 2023 17:06:59 -0500 Subject: [PATCH] Hydra only build x86_64-linux --- flake.nix | 120 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 62 insertions(+), 58 deletions(-) diff --git a/flake.nix b/flake.nix index 7714e5d..a802a55 100644 --- a/flake.nix +++ b/flake.nix @@ -50,7 +50,10 @@ propagatedBuildInputs = with pkgs; [ ffmpeg_5-headless ]; - + + meta = { + hydraPlatforms = [ "x86_64-linux" ]; + }; # Additional environment variables can be set directly # MY_CUSTOM_VAR = "some value"; }; @@ -65,70 +68,71 @@ inherit cargoArtifacts; }); in - { - checks = { - # Build the crate as part of `nix flake check` for convenience - inherit newalan; + { + checks = { + # Build the crate as part of `nix flake check` for convenience + inherit newalan; - # Run clippy (and deny all warnings) on the crate source, - # again, resuing the dependency artifacts from above. - # - # Note that this is done as a separate derivation so that - # we can block the CI if there are issues here, but not - # prevent downstream consumers from building our crate by itself. - newalan-clippy = craneLib.cargoClippy (commonArgs // { - inherit cargoArtifacts; - cargoClippyExtraArgs = "--all-targets -- --deny warnings"; - }); + # Run clippy (and deny all warnings) on the crate source, + # again, resuing the dependency artifacts from above. + # + # Note that this is done as a separate derivation so that + # we can block the CI if there are issues here, but not + # prevent downstream consumers from building our crate by itself. + newalan-clippy = craneLib.cargoClippy (commonArgs // { + inherit cargoArtifacts; + cargoClippyExtraArgs = "--all-targets -- --deny warnings"; + }); - newalan-doc = craneLib.cargoDoc (commonArgs // { - inherit cargoArtifacts; - }); + newalan-doc = craneLib.cargoDoc (commonArgs // { + inherit cargoArtifacts; + }); - # Check formatting - newalan-fmt = craneLib.cargoFmt { - inherit src; + # Check formatting + newalan-fmt = craneLib.cargoFmt { + inherit src; + }; + + # Audit dependencies + newalan-audit = craneLib.cargoAudit { + inherit src advisory-db; + }; + + # Run tests with cargo-nextest + # Consider setting `doCheck = false` on `newalan` if you do not want + # the tests to run twice + newalan-nextest = craneLib.cargoNextest (commonArgs // { + inherit cargoArtifacts; + partitions = 1; + partitionType = "count"; + }); + } // lib.optionalAttrs (system == "x86_64-linux") { + # NB: cargo-tarpaulin only supports x86_64 systems + # Check code coverage (note: this will not upload coverage anywhere) + newalan-coverage = craneLib.cargoTarpaulin (commonArgs // { + inherit cargoArtifacts; + }); }; - # Audit dependencies - newalan-audit = craneLib.cargoAudit { - inherit src advisory-db; + packages.default = newalan; + + apps.default = flake-utils.lib.mkApp { + drv = newalan; }; - # Run tests with cargo-nextest - # Consider setting `doCheck = false` on `newalan` if you do not want - # the tests to run twice - newalan-nextest = craneLib.cargoNextest (commonArgs // { - inherit cargoArtifacts; - partitions = 1; - partitionType = "count"; - }); - } // lib.optionalAttrs (system == "x86_64-linux") { - # NB: cargo-tarpaulin only supports x86_64 systems - # Check code coverage (note: this will not upload coverage anywhere) - newalan-coverage = craneLib.cargoTarpaulin (commonArgs // { - inherit cargoArtifacts; - }); - }; + devShells.default = pkgs.mkShell { + inputsFrom = builtins.attrValues self.checks.${system}; - packages.default = newalan; + # Additional dev-shell environment variables can be set directly + # MY_CUSTOM_DEVELOPMENT_VAR = "something else"; - apps.default = flake-utils.lib.mkApp { - drv = newalan; - }; - - devShells.default = pkgs.mkShell { - inputsFrom = builtins.attrValues self.checks.${system}; - - # Additional dev-shell environment variables can be set directly - # MY_CUSTOM_DEVELOPMENT_VAR = "something else"; - - # Extra inputs can be added here - nativeBuildInputs = with pkgs; [ - cargo - rustc - rust-analyzer - ]; - }; - }); + # Extra inputs can be added here + nativeBuildInputs = with pkgs; [ + cargo + rustc + rust-analyzer + ]; + }; + } + ); }