1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2024-12-14 11:47:31 +00:00
flake-parts/dev/flake-module.nix

34 lines
846 B
Nix

{ config, lib, inputs, withSystem, ... }:
{
imports = [
inputs.pre-commit-hooks-nix.flakeModule
inputs.hercules-ci-effects.flakeModule # herculesCI attr
];
systems = [ "x86_64-linux" "aarch64-darwin" ];
perSystem = { config, self', inputs', pkgs, ... }: {
devShells.default = pkgs.mkShell {
nativeBuildInputs = [
pkgs.nixpkgs-fmt
pkgs.pre-commit
];
shellHook = ''
${config.pre-commit.installationScript}
'';
};
pre-commit = {
inherit pkgs; # should make this default to the one it can get via follows
settings = {
hooks.nixpkgs-fmt.enable = true;
};
};
};
flake = {
# for repl exploration / debug
config.config = config;
options.mySystem = lib.mkOption { default = config.allSystems.${builtins.currentSystem}; };
};
}