mirror of
https://github.com/hercules-ci/flake-parts.git
synced 2024-12-14 11:47:31 +00:00
dev: Add nixpkgs-fmt to pre-commit
This commit is contained in:
parent
fcf9d5234b
commit
62e39568d5
5 changed files with 8 additions and 7 deletions
3
ci.nix
3
ci.nix
|
@ -4,7 +4,8 @@
|
|||
let
|
||||
flake = import ./dev;
|
||||
inherit (flake.inputs.nixpkgs) lib;
|
||||
in {
|
||||
in
|
||||
{
|
||||
inherit (flake) herculesCI;
|
||||
} // {
|
||||
checks = lib.recurseIntoAttrs flake.checks.${builtins.currentSystem};
|
||||
|
|
|
@ -9,4 +9,4 @@ let
|
|||
{ inherit self; }
|
||||
./flake-module.nix;
|
||||
in
|
||||
self.config.flake // { inherit (flake) inputs; }
|
||||
self.config.flake // { inherit (flake) inputs; }
|
||||
|
|
|
@ -20,6 +20,7 @@ flakeModuleArgs@{ config, lib, inputs, ... }:
|
|||
pre-commit = {
|
||||
inherit pkgs; # should make this default to the one it can get via follows
|
||||
settings = {
|
||||
hooks.nixpkgs-fmt.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -43,7 +44,7 @@ flakeModuleArgs@{ config, lib, inputs, ... }:
|
|||
flake = {
|
||||
options.herculesCI = lib.mkOption { type = lib.types.raw; };
|
||||
config.herculesCI = {
|
||||
onPush.default.outputs = {
|
||||
onPush.default.outputs = {
|
||||
inherit (config.flake) packages checks;
|
||||
};
|
||||
};
|
||||
|
|
4
lib.nix
4
lib.nix
|
@ -24,10 +24,10 @@ let
|
|||
options:
|
||||
mkOption {
|
||||
type = types.submoduleWith {
|
||||
modules = [ { inherit options; } ];
|
||||
modules = [{ inherit options; }];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
mkPerSystemType =
|
||||
module:
|
||||
types.functionTo (types.submoduleWith {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Definitions can be imported from a separate file like this one
|
||||
|
||||
{ self, ... }: {
|
||||
|
@ -15,4 +14,4 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue