feat: add pre-commit hooks
This commit is contained in:
parent
56eeaad725
commit
7f4c0310db
4 changed files with 171 additions and 78 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,2 +1,5 @@
|
||||||
### direnv ###
|
### direnv ###
|
||||||
.direnv
|
.direnv
|
||||||
|
|
||||||
|
### pre-commit ###
|
||||||
|
.pre-commit-config.yaml
|
||||||
|
|
|
||||||
3
alejandra.toml
Normal file
3
alejandra.toml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
# (experimental) Configuration options for Alejandra
|
||||||
|
|
||||||
|
indentation = "TwoSpaces" # Or: FourSpaces, Tabs
|
||||||
112
flake.lock
generated
112
flake.lock
generated
|
|
@ -176,6 +176,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1696426674,
|
||||||
|
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-compat_2": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1733328505,
|
"lastModified": 1733328505,
|
||||||
|
|
@ -191,7 +207,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-compat_2": {
|
"flake-compat_3": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1696426674,
|
"lastModified": 1696426674,
|
||||||
|
|
@ -207,7 +223,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-compat_3": {
|
"flake-compat_4": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1696426674,
|
"lastModified": 1696426674,
|
||||||
|
|
@ -344,8 +360,8 @@
|
||||||
},
|
},
|
||||||
"git-hooks": {
|
"git-hooks": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat_2",
|
"flake-compat": "flake-compat_3",
|
||||||
"gitignore": "gitignore",
|
"gitignore": "gitignore_2",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"neovim-nightly-overlay",
|
"neovim-nightly-overlay",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
|
|
@ -365,7 +381,48 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"git-hooks-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"gitignore": "gitignore",
|
||||||
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1742649964,
|
||||||
|
"narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"gitignore": {
|
"gitignore": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"git-hooks-nix",
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gitignore_2": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"neovim-nightly-overlay",
|
"neovim-nightly-overlay",
|
||||||
|
|
@ -387,7 +444,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"gitignore_2": {
|
"gitignore_3": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"pre-commit-hooks",
|
"pre-commit-hooks",
|
||||||
|
|
@ -496,7 +553,7 @@
|
||||||
"jovian": {
|
"jovian": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nix-github-actions": "nix-github-actions",
|
"nix-github-actions": "nix-github-actions",
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1744436521,
|
"lastModified": 1744436521,
|
||||||
|
|
@ -551,12 +608,12 @@
|
||||||
},
|
},
|
||||||
"neovim-nightly-overlay": {
|
"neovim-nightly-overlay": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat_2",
|
||||||
"flake-parts": "flake-parts_2",
|
"flake-parts": "flake-parts_2",
|
||||||
"git-hooks": "git-hooks",
|
"git-hooks": "git-hooks",
|
||||||
"hercules-ci-effects": "hercules-ci-effects",
|
"hercules-ci-effects": "hercules-ci-effects",
|
||||||
"neovim-src": "neovim-src",
|
"neovim-src": "neovim-src",
|
||||||
"nixpkgs": "nixpkgs_3",
|
"nixpkgs": "nixpkgs_4",
|
||||||
"treefmt-nix": "treefmt-nix_2"
|
"treefmt-nix": "treefmt-nix_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|
@ -777,6 +834,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1730768919,
|
||||||
|
"narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "a04d33c0c3f1a59a2c1cb0c6e34cd24500e5a1dc",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1743583204,
|
"lastModified": 1743583204,
|
||||||
"narHash": "sha256-F7n4+KOIfWrwoQjXrL2wD9RhFYLs2/GGe/MQY1sSdlE=",
|
"narHash": "sha256-F7n4+KOIfWrwoQjXrL2wD9RhFYLs2/GGe/MQY1sSdlE=",
|
||||||
|
|
@ -792,7 +865,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1744316434,
|
"lastModified": 1744316434,
|
||||||
"narHash": "sha256-lzFCg/1C39pyY2hMB2gcuHV79ozpOz/Vu15hdjiFOfI=",
|
"narHash": "sha256-lzFCg/1C39pyY2hMB2gcuHV79ozpOz/Vu15hdjiFOfI=",
|
||||||
|
|
@ -808,7 +881,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_5": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1744442362,
|
"lastModified": 1744442362,
|
||||||
"narHash": "sha256-i47t4DRIZgwBZw2Osbrp1OJhhO1k/n+QzRx+TrmfE9Y=",
|
"narHash": "sha256-i47t4DRIZgwBZw2Osbrp1OJhhO1k/n+QzRx+TrmfE9Y=",
|
||||||
|
|
@ -824,7 +897,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_5": {
|
"nixpkgs_6": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1744232761,
|
"lastModified": 1744232761,
|
||||||
"narHash": "sha256-gbl9hE39nQRpZaLjhWKmEu5ejtQsgI5TWYrIVVJn30U=",
|
"narHash": "sha256-gbl9hE39nQRpZaLjhWKmEu5ejtQsgI5TWYrIVVJn30U=",
|
||||||
|
|
@ -840,7 +913,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_6": {
|
"nixpkgs_7": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730768919,
|
"lastModified": 1730768919,
|
||||||
"narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=",
|
"narHash": "sha256-8AKquNnnSaJRXZxc5YmF/WfmxiHX6MMZZasRP6RRQkE=",
|
||||||
|
|
@ -856,7 +929,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_7": {
|
"nixpkgs_8": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1692934111,
|
"lastModified": 1692934111,
|
||||||
"narHash": "sha256-9EEE59v/esKNMR5zKbLRV9NoRPYvERw5jHQOnfr47bk=",
|
"narHash": "sha256-9EEE59v/esKNMR5zKbLRV9NoRPYvERw5jHQOnfr47bk=",
|
||||||
|
|
@ -899,7 +972,7 @@
|
||||||
"nur": {
|
"nur": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts_4",
|
"flake-parts": "flake-parts_4",
|
||||||
"nixpkgs": "nixpkgs_5",
|
"nixpkgs": "nixpkgs_6",
|
||||||
"treefmt-nix": "treefmt-nix_3"
|
"treefmt-nix": "treefmt-nix_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|
@ -941,9 +1014,9 @@
|
||||||
},
|
},
|
||||||
"pre-commit-hooks": {
|
"pre-commit-hooks": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat_3",
|
"flake-compat": "flake-compat_4",
|
||||||
"gitignore": "gitignore_2",
|
"gitignore": "gitignore_3",
|
||||||
"nixpkgs": "nixpkgs_6"
|
"nixpkgs": "nixpkgs_7"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1742649964,
|
"lastModified": 1742649964,
|
||||||
|
|
@ -966,6 +1039,7 @@
|
||||||
"clan-core": "clan-core",
|
"clan-core": "clan-core",
|
||||||
"filetags": "filetags",
|
"filetags": "filetags",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
|
"git-hooks-nix": "git-hooks-nix",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"impermanence": "impermanence",
|
"impermanence": "impermanence",
|
||||||
"jovian": "jovian",
|
"jovian": "jovian",
|
||||||
|
|
@ -974,7 +1048,7 @@
|
||||||
"niri": "niri",
|
"niri": "niri",
|
||||||
"nix-index-database": "nix-index-database",
|
"nix-index-database": "nix-index-database",
|
||||||
"nix-monitored": "nix-monitored",
|
"nix-monitored": "nix-monitored",
|
||||||
"nixpkgs": "nixpkgs_4",
|
"nixpkgs": "nixpkgs_5",
|
||||||
"nixvim": "nixvim",
|
"nixvim": "nixvim",
|
||||||
"nur": "nur",
|
"nur": "nur",
|
||||||
"pre-commit-hooks": "pre-commit-hooks",
|
"pre-commit-hooks": "pre-commit-hooks",
|
||||||
|
|
@ -1099,7 +1173,7 @@
|
||||||
"timers": {
|
"timers": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"naersk": "naersk",
|
"naersk": "naersk",
|
||||||
"nixpkgs": "nixpkgs_7",
|
"nixpkgs": "nixpkgs_8",
|
||||||
"utils": "utils"
|
"utils": "utils"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|
|
||||||
131
flake.nix
131
flake.nix
|
|
@ -1,76 +1,89 @@
|
||||||
{
|
{
|
||||||
inputs =
|
inputs = {
|
||||||
{
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
master.url = "github:nixos/nixpkgs";
|
||||||
master.url = "github:nixos/nixpkgs";
|
stable.url = "github:nixos/nixpkgs/nixos-24.11";
|
||||||
stable.url = "github:nixos/nixpkgs/nixos-24.11";
|
|
||||||
|
|
||||||
# New flake-parts input
|
# New flake-parts input
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||||
|
git-hooks-nix.url = "github:cachix/git-hooks.nix";
|
||||||
|
|
||||||
clan-core = {
|
clan-core = {
|
||||||
url = "git+https://git.clan.lol/clan/clan-core";
|
url = "git+https://git.clan.lol/clan/clan-core";
|
||||||
inputs.nixpkgs.follows = "nixpkgs"; # Needed if your configuration uses nixpkgs unstable.
|
inputs.nixpkgs.follows = "nixpkgs"; # Needed if your configuration uses nixpkgs unstable.
|
||||||
# New
|
inputs.flake-parts.follows = "flake-parts";
|
||||||
inputs.flake-parts.follows = "flake-parts";
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
home-manager.url = "github:nix-community/home-manager";
|
|
||||||
|
|
||||||
impermanence.url = "github:nix-community/impermanence";
|
|
||||||
|
|
||||||
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
|
|
||||||
|
|
||||||
nur.url = "github:nix-community/NUR";
|
|
||||||
|
|
||||||
nix-index-database.url = "github:Mic92/nix-index-database";
|
|
||||||
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
|
|
||||||
nix-monitored.url = "github:ners/nix-monitored";
|
|
||||||
nix-monitored.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
|
|
||||||
jovian.url = "github:Jovian-Experiments/Jovian-NixOS";
|
|
||||||
|
|
||||||
# Programs
|
|
||||||
timers.url = "git+https://gitea.moritzboeh.me/moritz/timers.git";
|
|
||||||
filetags.url = "git+https://gitea.moritzboeh.me/moritz/filetags.git";
|
|
||||||
|
|
||||||
# Neovim
|
|
||||||
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
|
|
||||||
|
|
||||||
nixvim.url = "github:nix-community/nixvim";
|
|
||||||
nixvim.inputs.flake-parts.follows = "flake-parts";
|
|
||||||
nixvim.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
|
|
||||||
# Niri
|
|
||||||
niri.url = "github:sodiboo/niri-flake";
|
|
||||||
niri.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
|
|
||||||
# Laptop
|
|
||||||
asus-touchpad-numpad-driver.url = "github:MoritzBoehme/asus-touchpad-numpad-driver/german-layout";
|
|
||||||
asus-touchpad-numpad-driver.flake = false;
|
|
||||||
|
|
||||||
# Firefox user.js
|
|
||||||
arkenfox-userjs.url = "github:arkenfox/user.js";
|
|
||||||
arkenfox-userjs.flake = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs@{ flake-parts, ... }:
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
flake-parts.lib.mkFlake { inherit inputs; } ({ self, pkgs, ... }: {
|
home-manager.url = "github:nix-community/home-manager";
|
||||||
|
|
||||||
|
impermanence.url = "github:nix-community/impermanence";
|
||||||
|
|
||||||
|
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
|
||||||
|
|
||||||
|
nur.url = "github:nix-community/NUR";
|
||||||
|
|
||||||
|
nix-index-database.url = "github:Mic92/nix-index-database";
|
||||||
|
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
|
nix-monitored.url = "github:ners/nix-monitored";
|
||||||
|
nix-monitored.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
|
jovian.url = "github:Jovian-Experiments/Jovian-NixOS";
|
||||||
|
|
||||||
|
# Programs
|
||||||
|
timers.url = "git+https://gitea.moritzboeh.me/moritz/timers.git";
|
||||||
|
filetags.url = "git+https://gitea.moritzboeh.me/moritz/filetags.git";
|
||||||
|
|
||||||
|
# Neovim
|
||||||
|
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
|
||||||
|
|
||||||
|
nixvim.url = "github:nix-community/nixvim";
|
||||||
|
nixvim.inputs.flake-parts.follows = "flake-parts";
|
||||||
|
nixvim.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
|
# Niri
|
||||||
|
niri.url = "github:sodiboo/niri-flake";
|
||||||
|
niri.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
|
# Laptop
|
||||||
|
asus-touchpad-numpad-driver.url = "github:MoritzBoehme/asus-touchpad-numpad-driver/german-layout";
|
||||||
|
asus-touchpad-numpad-driver.flake = false;
|
||||||
|
|
||||||
|
# Firefox user.js
|
||||||
|
arkenfox-userjs.url = "github:arkenfox/user.js";
|
||||||
|
arkenfox-userjs.flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = inputs @ {flake-parts, ...}:
|
||||||
|
flake-parts.lib.mkFlake {inherit inputs;} ({self, ...}: {
|
||||||
# We define our own systems below. you can still use this to add system specific outputs to your flake.
|
# We define our own systems below. you can still use this to add system specific outputs to your flake.
|
||||||
# See: https://flake.parts/getting-started
|
# See: https://flake.parts/getting-started
|
||||||
systems = [ "x86_64-linux" ];
|
systems = ["x86_64-linux"];
|
||||||
|
|
||||||
# import clan-core modules
|
# import clan-core modules
|
||||||
imports = [
|
imports = [
|
||||||
inputs.clan-core.flakeModules.default
|
inputs.clan-core.flakeModules.default
|
||||||
|
inputs.git-hooks-nix.flakeModule
|
||||||
];
|
];
|
||||||
|
|
||||||
perSystem = { config, inputs', pkgs, ... }: {
|
perSystem = {
|
||||||
|
config,
|
||||||
|
inputs',
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
packages = [ inputs'.clan-core.packages.clan-cli ];
|
inherit (config.pre-commit.devShell) shellHook nativeBuildInputs;
|
||||||
|
packages = [inputs'.clan-core.packages.clan-cli pkgs.alejandra];
|
||||||
|
};
|
||||||
|
pre-commit.settings.hooks = {
|
||||||
|
alejandra.enable = true;
|
||||||
|
check-merge-conflicts.enable = true;
|
||||||
|
flake-checker.enable = true;
|
||||||
|
deadnix.enable = true;
|
||||||
|
nil.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue