My NixOS configuration (mirror)

feat: added pre-commit alejandra hook

+87 -5
+1
.gitignore
··· 1 1 result 2 2 .direnv 3 3 nixos-switch.log 4 + .pre-commit-config.yaml
+65 -5
flake.lock
··· 38 38 "flake-compat_2": { 39 39 "flake": false, 40 40 "locked": { 41 + "lastModified": 1747046372, 42 + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", 43 + "owner": "edolstra", 44 + "repo": "flake-compat", 45 + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", 46 + "type": "github" 47 + }, 48 + "original": { 49 + "owner": "edolstra", 50 + "repo": "flake-compat", 51 + "type": "github" 52 + } 53 + }, 54 + "flake-compat_3": { 55 + "flake": false, 56 + "locked": { 41 57 "lastModified": 1751685974, 42 58 "narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=", 43 59 "ref": "refs/heads/main", ··· 51 67 "url": "https://git.lix.systems/lix-project/flake-compat.git" 52 68 } 53 69 }, 54 - "flake-compat_3": { 70 + "flake-compat_4": { 55 71 "flake": false, 56 72 "locked": { 57 73 "lastModified": 1747046372, ··· 67 83 "type": "github" 68 84 } 69 85 }, 70 - "flake-compat_4": { 86 + "flake-compat_5": { 71 87 "flake": false, 72 88 "locked": { 73 89 "lastModified": 1650374568, ··· 201 217 "type": "github" 202 218 } 203 219 }, 220 + "git-hooks": { 221 + "inputs": { 222 + "flake-compat": "flake-compat_2", 223 + "gitignore": "gitignore", 224 + "nixpkgs": [ 225 + "nixpkgs" 226 + ] 227 + }, 228 + "locked": { 229 + "lastModified": 1760663237, 230 + "narHash": "sha256-BflA6U4AM1bzuRMR8QqzPXqh8sWVCNDzOdsxXEguJIc=", 231 + "owner": "cachix", 232 + "repo": "git-hooks.nix", 233 + "rev": "ca5b894d3e3e151ffc1db040b6ce4dcc75d31c37", 234 + "type": "github" 235 + }, 236 + "original": { 237 + "owner": "cachix", 238 + "repo": "git-hooks.nix", 239 + "type": "github" 240 + } 241 + }, 242 + "gitignore": { 243 + "inputs": { 244 + "nixpkgs": [ 245 + "git-hooks", 246 + "nixpkgs" 247 + ] 248 + }, 249 + "locked": { 250 + "lastModified": 1709087332, 251 + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", 252 + "owner": "hercules-ci", 253 + "repo": "gitignore.nix", 254 + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", 255 + "type": "github" 256 + }, 257 + "original": { 258 + "owner": "hercules-ci", 259 + "repo": "gitignore.nix", 260 + "type": "github" 261 + } 262 + }, 204 263 "home-manager": { 205 264 "inputs": { 206 265 "nixpkgs": "nixpkgs" ··· 458 517 }, 459 518 "nvf": { 460 519 "inputs": { 461 - "flake-compat": "flake-compat_2", 520 + "flake-compat": "flake-compat_3", 462 521 "flake-parts": "flake-parts", 463 522 "mnw": "mnw", 464 523 "nixpkgs": "nixpkgs_6", ··· 482 541 "inputs": { 483 542 "dustpan": "dustpan", 484 543 "ghostty": "ghostty", 544 + "git-hooks": "git-hooks", 485 545 "home-manager": "home-manager_2", 486 546 "kwin-effects-forceblur": "kwin-effects-forceblur", 487 547 "niri": "niri", ··· 493 553 }, 494 554 "snowfall-lib": { 495 555 "inputs": { 496 - "flake-compat": "flake-compat_4", 556 + "flake-compat": "flake-compat_5", 497 557 "flake-utils-plus": "flake-utils-plus", 498 558 "nixpkgs": [ 499 559 "solaar", ··· 517 577 }, 518 578 "solaar": { 519 579 "inputs": { 520 - "flake-compat": "flake-compat_3", 580 + "flake-compat": "flake-compat_4", 521 581 "nixpkgs": [ 522 582 "nixpkgs" 523 583 ],
+21
flake.nix
··· 4 4 inputs = { 5 5 dustpan.url = "github:matthew-hre/dustpan"; 6 6 7 + git-hooks.url = "github:cachix/git-hooks.nix"; 8 + git-hooks.inputs.nixpkgs.follows = "nixpkgs"; 9 + 7 10 home-manager.url = "github:nix-community/home-manager"; 8 11 home-manager.inputs.nixpkgs.follows = "nixpkgs"; 9 12 ··· 35 38 ghostty, 36 39 home-manager, 37 40 nixpkgs, 41 + self, 38 42 ... 39 43 }: let 40 44 system = "x86_64-linux"; ··· 71 75 ]; 72 76 thwomp = mkHost "thwomp" [./hosts/thwomp/configuration.nix]; 73 77 }; 78 + 79 + checks.${system} = { 80 + pre-commit-check = inputs.git-hooks.lib.${system}.run { 81 + src = ./.; 82 + hooks = { 83 + alejandra.enable = true; 84 + }; 85 + }; 86 + }; 87 + 88 + devShells.${system}.default = let 89 + pkgs = nixpkgs.legacyPackages.${system}; 90 + in 91 + pkgs.mkShell { 92 + inherit (self.checks.${system}.pre-commit-check) shellHook; 93 + buildInputs = self.checks.${system}.pre-commit-check.enabledPackages; 94 + }; 74 95 75 96 formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra; 76 97 };