Convert to manual pre-commit
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
host
|
||||
result
|
||||
.pre-commit-config.yaml
|
||||
.direnv
|
||||
# On home-manager only installs, this is built into the same dir
|
||||
# where I am storing my repo
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v6.0.0
|
||||
hooks:
|
||||
- id: check-added-large-files
|
||||
- id: check-case-conflict
|
||||
- id: check-illegal-windows-names
|
||||
- id: check-json
|
||||
- id: check-merge-conflict
|
||||
args:
|
||||
- "--assume-in-merge"
|
||||
- id: check-shebang-scripts-are-executable
|
||||
- id: check-symlinks
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
- id: fix-byte-order-marker
|
||||
- id: mixed-line-ending
|
||||
- id: trailing-whitespace
|
||||
- repo: https://github.com/adrienverge/yamllint.git
|
||||
rev: v1.37.1
|
||||
hooks:
|
||||
- id: yamllint
|
||||
args:
|
||||
- "-d"
|
||||
- |-
|
||||
extends: default
|
||||
ignore:
|
||||
- manifests/cnpg-system/barman-cloud.yaml
|
||||
rules:
|
||||
comments: false
|
||||
comments-indentation: false
|
||||
document-start: false
|
||||
- repo: https://github.com/NixOS/nixfmt
|
||||
rev: v1.1.0
|
||||
hooks:
|
||||
- id: nixfmt-nix
|
||||
- repo: https://github.com/astro/deadnix
|
||||
rev: v1.3.1
|
||||
hooks:
|
||||
- id: deadnix
|
||||
+3
-34
@@ -1,5 +1,4 @@
|
||||
{
|
||||
hooks,
|
||||
lib,
|
||||
system,
|
||||
top,
|
||||
@@ -9,39 +8,9 @@
|
||||
let
|
||||
meta = import ./hosts/metadata.nix;
|
||||
in
|
||||
{
|
||||
pre-commit-check = hooks.lib.${system}.run {
|
||||
src = ./.;
|
||||
hooks = {
|
||||
deadnix.enable = true;
|
||||
# Needs https://github.com/DeterminateSystems/flake-checker/pull/130
|
||||
#flake-checker.enable = true;
|
||||
nixfmt-rfc-style.enable = true;
|
||||
check-merge-conflicts.enable = true;
|
||||
check-yaml.enable = true;
|
||||
yamllint = {
|
||||
enable = true;
|
||||
args = [
|
||||
"--config-data"
|
||||
(lib.generators.toYAML { } {
|
||||
extends = "default";
|
||||
ignore = [
|
||||
"manifests/cnpg-system/barman-cloud.yaml"
|
||||
".pre-commit-config.yaml"
|
||||
];
|
||||
rules = {
|
||||
comments = false;
|
||||
comments-indentation = false;
|
||||
document-start = false;
|
||||
};
|
||||
})
|
||||
];
|
||||
verbose = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
// (builtins.mapAttrs (_n: v: v.config.system.build.toplevel) (
|
||||
# Pulls all hosts down to be a check
|
||||
(builtins.mapAttrs (_n: v: v.config.system.build.toplevel) (
|
||||
lib.filterAttrs (n: _v: builtins.any (a: a == system) meta.${n}.arch) top.self.nixosConfigurations
|
||||
))
|
||||
# Adds all packages as a check
|
||||
// (top.self.packages.${system})
|
||||
|
||||
Generated
+6
-80
@@ -160,22 +160,6 @@
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1761588595,
|
||||
"narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat_2": {
|
||||
"locked": {
|
||||
"lastModified": 1747046372,
|
||||
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
|
||||
@@ -190,7 +174,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat_3": {
|
||||
"flake-compat_2": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1761588595,
|
||||
@@ -358,27 +342,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"hooks",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1709087332,
|
||||
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"haumea": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -468,26 +431,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"gitignore": "gitignore",
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1763988335,
|
||||
"narHash": "sha256-QlcnByMc8KBjpU37rbq5iP7Cp97HvjRP0ucfdh+M4Qc=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "50b9238891e388c9fdc6a5c49e49c42533a1b5ce",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"ixx": {
|
||||
"inputs": {
|
||||
"flake-utils": [
|
||||
@@ -713,22 +656,6 @@
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1759417375,
|
||||
"narHash": "sha256-O7eHcgkQXJNygY6AypkF9tFhsoDQjpNEojw3eFs73Ow=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "dc704e6102e76aad573f63b74c742cd96f8f1e6c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1764517877,
|
||||
"narHash": "sha256-pp3uT4hHijIC8JUK5MEqeAWmParJrgBVzHLNfJDZxg4=",
|
||||
@@ -744,7 +671,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_5": {
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1759770925,
|
||||
"narHash": "sha256-CZwkCtzTNclqlhuwDsVtGoRumTpqCUK0xSnFIMgd8ls=",
|
||||
@@ -803,7 +730,7 @@
|
||||
"nurpkgs": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts_4",
|
||||
"nixpkgs": "nixpkgs_4"
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1764709261,
|
||||
@@ -869,7 +796,7 @@
|
||||
},
|
||||
"proxmox": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_2",
|
||||
"flake-compat": "flake-compat",
|
||||
"nixpkgs-libvncserver": "nixpkgs-libvncserver",
|
||||
"nixpkgs-stable": "nixpkgs-stable",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable_2",
|
||||
@@ -898,7 +825,6 @@
|
||||
"darwin": "darwin_2",
|
||||
"flake-parts": "flake-parts_2",
|
||||
"hmunstable": "hmunstable",
|
||||
"hooks": "hooks",
|
||||
"nix-hardware": "nix-hardware",
|
||||
"nixos-generators": "nixos-generators",
|
||||
"nixunstable": "nixunstable",
|
||||
@@ -1092,7 +1018,7 @@
|
||||
},
|
||||
"vsext": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_5"
|
||||
"nixpkgs": "nixpkgs_4"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1764640937,
|
||||
@@ -1110,7 +1036,7 @@
|
||||
},
|
||||
"wsl": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_3",
|
||||
"flake-compat": "flake-compat_2",
|
||||
"nixpkgs": [
|
||||
"nixunstable"
|
||||
]
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
inputs.nixpkgs.follows = "nixunstable";
|
||||
};
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
hooks.url = "github:cachix/git-hooks.nix";
|
||||
hmunstable = {
|
||||
url = "github:nix-community/home-manager/master";
|
||||
inputs.nixpkgs.follows = "nixunstable";
|
||||
|
||||
@@ -217,4 +217,3 @@ let g:ctrlp_user_command = {
|
||||
\}
|
||||
" let g:ctrpl_match_func = { 'match': 'pymatcher#PyMatch' }
|
||||
" map <F6> <Esc>:CtrlP<Cr>
|
||||
|
||||
|
||||
+3
-4
@@ -1,5 +1,4 @@
|
||||
{
|
||||
self',
|
||||
pkgs,
|
||||
nixvimunstable,
|
||||
...
|
||||
@@ -18,19 +17,19 @@ let
|
||||
in
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
inherit (self'.checks.pre-commit-check) shellHook;
|
||||
buildInputs = with pkgs; [
|
||||
bashInteractive
|
||||
stdenv.cc
|
||||
curl
|
||||
git
|
||||
gnutar
|
||||
gzip
|
||||
inject
|
||||
inject-darwin
|
||||
nushell
|
||||
vim
|
||||
self'.checks.pre-commit-check.enabledPackages
|
||||
tmux
|
||||
xonsh
|
||||
zellij
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user