Add pre-commit check and devShell
Some checks failed
Check flake / build-amd64-linux (push) Failing after 3m9s
Some checks failed
Check flake / build-amd64-linux (push) Failing after 3m9s
This commit is contained in:
parent
ccb57f954e
commit
5a8b6bc354
41
flake.nix
41
flake.nix
@ -61,7 +61,6 @@
|
|||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
|
|
||||||
domain = "mesh.vimium.net";
|
domain = "mesh.vimium.net";
|
||||||
forEverySystem = lib.getAttrs lib.systems.flakeExposed;
|
|
||||||
forEachSystem = lib.genAttrs [
|
forEachSystem = lib.genAttrs [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
"aarch64-linux"
|
"aarch64-linux"
|
||||||
@ -114,14 +113,42 @@
|
|||||||
))
|
))
|
||||||
];
|
];
|
||||||
|
|
||||||
|
checks =
|
||||||
|
builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib
|
||||||
|
// (forEachSystem (system: {
|
||||||
|
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
|
||||||
|
src = ./.;
|
||||||
|
hooks = {
|
||||||
|
check-case-conflicts.enable = true;
|
||||||
|
check-executables-have-shebangs.enable = true;
|
||||||
|
check-merge-conflicts.enable = true;
|
||||||
|
deadnix = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
noLambdaArg = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
detect-private-keys.enable = true;
|
||||||
|
end-of-file-fixer.enable = true;
|
||||||
|
fix-byte-order-marker.enable = true;
|
||||||
|
mixed-line-endings.enable = true;
|
||||||
|
nixfmt-rfc-style.enable = true;
|
||||||
|
trim-trailing-whitespace.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}));
|
||||||
|
|
||||||
formatter = forEachSystem (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
|
formatter = forEachSystem (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
|
||||||
|
|
||||||
devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell {
|
devShells = forEachSystem (system: {
|
||||||
|
default = nixpkgs.legacyPackages.${system}.mkShell {
|
||||||
|
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
inputs.agenix.packages.x86_64-linux.agenix
|
inputs.agenix.packages.${system}.agenix
|
||||||
inputs.deploy-rs.packages.x86_64-linux.deploy-rs
|
inputs.deploy-rs.packages.${system}.deploy-rs
|
||||||
];
|
] ++ self.checks.${system}.pre-commit-check.enabledPackages;
|
||||||
};
|
};
|
||||||
|
});
|
||||||
|
|
||||||
deploy = {
|
deploy = {
|
||||||
magicRollback = true;
|
magicRollback = true;
|
||||||
@ -134,9 +161,5 @@
|
|||||||
"vps1"
|
"vps1"
|
||||||
] mkDeployNode;
|
] mkDeployNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
checks = builtins.mapAttrs (
|
|
||||||
system: deployLib: deployLib.deployChecks self.deploy
|
|
||||||
) inputs.deploy-rs.lib;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user