blob: 98056513f2e2d7db1fb56d7f954a767841001b98 [file]
{
description = "GitHub Actions for Rust projects";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
pre-commit-hooks,
}: let
forEachSystem = nixpkgs.lib.genAttrs [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
in {
checks = forEachSystem (system: let
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
actionlint.enable = true;
alejandra.enable = true;
prettier.enable = true;
};
};
in {
inherit pre-commit-check;
});
devShells = forEachSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
default = pkgs.mkShell {
buildInputs = [pkgs.nodejs];
inherit (self.checks.${system}.pre-commit-check) shellHook;
};
});
};
}