Revert "ci: improvements to building in pipeline"

This reverts commit d8b232b546.
This commit is contained in:
silver 2024-06-03 23:26:47 +01:00
parent bee41c192f
commit 394d6b4545
4 changed files with 65 additions and 100 deletions

View file

@ -2,8 +2,8 @@
description = "Skynet Discord Bot";
inputs = {
nixpkgs.url = "nixpkgs/nixos-24.05";
crane.url = "github:ipetkov/crane";
nixpkgs.url = "nixpkgs/nixos-23.05";
naersk.url = "github:nix-community/naersk";
utils.url = "github:numtide/flake-utils";
};
@ -21,67 +21,26 @@
self,
nixpkgs,
utils,
crane,
naersk,
}:
utils.lib.eachDefaultSystem (
system: let
pkgs = nixpkgs.legacyPackages."${system}";
naersk-lib = naersk.lib."${system}";
package_name = "skynet_discord_bot";
desc = "Skynet Discord Bot";
craneLib = crane.mkLib pkgs;
src = craneLib.cleanCargoSource (craneLib.path ./.);
commonArgs = {
src = src;
strictDeps = true;
in rec {
# `nix build`
packages."${package_name}" = naersk-lib.buildPackage {
pname = "${package_name}";
root = ./.;
buildInputs = with pkgs; [
# Add extra build inputs here, etc.
openssl
];
nativeBuildInputs = with pkgs; [
# Add extra native build inputs here, etc.
pkg-config
];
};
cargoArtifacts = craneLib.buildDepsOnly (commonArgs
// {
pname = "${package_name}-deps";
});
clippy = craneLib.cargoClippy (commonArgs
// {
inherit cargoArtifacts;
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
});
fmt = craneLib.cargoFmt {
inherit src;
};
result = craneLib.buildPackage (commonArgs
// {
inherit cargoArtifacts;
});
in rec {
packages = {
# nix build --verbose
"${package_name}" = result;
# nix build --verbose .#clippy
clippy = clippy;
# nix build --verbose .#fmt
fmt = fmt;
};
defaultPackage = packages."${package_name}";
# `nix run`