my over complex system configurations dotfiles.isabelroses.com/
nixos nix flake dotfiles linux
at isos 48 lines 1.2 kB view raw
1{inputs, ...}: { 2 imports = [inputs.pre-commit-hooks.flakeModule]; 3 4 perSystem = {config, ...}: let 5 # don't format these 6 excludes = ["flake.lock" "r'.+\.age$'"]; 7 8 mkHook = name: prev: 9 { 10 inherit excludes; 11 description = "pre-commit hook for ${name}"; 12 fail_fast = true; 13 verbose = true; 14 } 15 // prev; 16 in { 17 pre-commit = { 18 check.enable = true; 19 20 settings = { 21 inherit excludes; 22 23 hooks = { 24 alejandra = mkHook "Alejandra" {enable = true;}; 25 actionlint = mkHook "actionlint" {enable = true;}; 26 # prettier = mkHook "prettier" {enable = true;}; 27 commitizen = mkHook "commitizen" {enable = true;}; 28 # nil = mkHook "nil" {enable = true;}; 29 editorconfig-checker = mkHook "editorconfig" { 30 enable = false; 31 always_run = true; 32 }; 33 }; 34 35 settings = { 36 # prettier = { 37 # binPath = "${pkgs.prettierd}/bin/prettierd"; 38 # write = true; 39 # }; 40 41 treefmt = { 42 package = config.treefmt.build.wrapper; 43 }; 44 }; 45 }; 46 }; 47 }; 48}