refactor(nix): use pre-commit flake module
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
bbf4e3b04d
commit
2918d61b16
@ -25,6 +25,8 @@
|
|||||||
{inherit inputs;}
|
{inherit inputs;}
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
inputs.pre-commit-hooks.flakeModule
|
||||||
|
|
||||||
./nix/dev.nix
|
./nix/dev.nix
|
||||||
./nix/distribution.nix
|
./nix/distribution.nix
|
||||||
];
|
];
|
||||||
|
20
nix/dev.nix
20
nix/dev.nix
@ -1,16 +1,11 @@
|
|||||||
{
|
{
|
||||||
inputs,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
perSystem = {
|
perSystem = {
|
||||||
system,
|
config,
|
||||||
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
checks = {
|
pre-commit.settings = {
|
||||||
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
|
|
||||||
src = self;
|
|
||||||
hooks = {
|
hooks = {
|
||||||
markdownlint.enable = true;
|
markdownlint.enable = true;
|
||||||
|
|
||||||
@ -24,14 +19,15 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
tools.clang-tools = pkgs.clang-tools_16;
|
tools.clang-tools = lib.mkForce pkgs.clang-tools_16;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
shellHook = ''
|
||||||
|
${config.pre-commit.installationScript}
|
||||||
|
'';
|
||||||
|
|
||||||
inputsFrom = [self.packages.${system}.prismlauncher-unwrapped];
|
inputsFrom = [config.packages.prismlauncher-unwrapped];
|
||||||
buildInputs = with pkgs; [ccache ninja];
|
buildInputs = with pkgs; [ccache ninja];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user