Hydra only build x86_64-linux

This commit is contained in:
2023-03-06 17:06:59 -05:00
parent 9ca04fbfd5
commit 1cc2582e02

120
flake.nix
View File

@@ -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
];
};
}
);
}