1
0
Fork 0

Add pre-commit

This commit is contained in:
Ethan Reece 2025-07-09 04:23:56 -05:00
parent 138a204f13
commit 47e40f6254
Signed by: me
GPG key ID: 198E9EB433DB1B28
3 changed files with 110 additions and 24 deletions

84
flake.lock generated
View file

@ -18,6 +18,22 @@
"type": "github" "type": "github"
} }
}, },
"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-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@ -107,6 +123,47 @@
"type": "github" "type": "github"
} }
}, },
"git-hooks-nix": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1750779888,
"narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"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"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -200,6 +257,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": 1749776303, "lastModified": 1749776303,
"narHash": "sha256-OHibOvVwKqO1qvRg0r3agtd1EagW4THBcoWT7QGgcNo=", "narHash": "sha256-OHibOvVwKqO1qvRg0r3agtd1EagW4THBcoWT7QGgcNo=",
@ -215,7 +288,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_3": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1749285348, "lastModified": 1749285348,
"narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=", "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=",
@ -231,7 +304,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_4": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1747958103, "lastModified": 1747958103,
"narHash": "sha256-qmmFCrfBwSHoWw7cVK4Aj+fns+c54EBP8cGqp/yK410=", "narHash": "sha256-qmmFCrfBwSHoWw7cVK4Aj+fns+c54EBP8cGqp/yK410=",
@ -250,7 +323,7 @@
"nur": { "nur": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_2", "flake-parts": "flake-parts_2",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_4",
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
@ -271,10 +344,11 @@
"inputs": { "inputs": {
"devshell": "devshell", "devshell": "devshell",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"git-hooks-nix": "git-hooks-nix",
"home-manager": "home-manager", "home-manager": "home-manager",
"lix-module": "lix-module", "lix-module": "lix-module",
"nixgl": "nixgl", "nixgl": "nixgl",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_3",
"nur": "nur", "nur": "nur",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"treefmt-nix": "treefmt-nix_2" "treefmt-nix": "treefmt-nix_2"
@ -338,7 +412,7 @@
}, },
"treefmt-nix_2": { "treefmt-nix_2": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_5"
}, },
"locked": { "locked": {
"lastModified": 1750931469, "lastModified": 1750931469,

View file

@ -21,13 +21,13 @@
}; };
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
git-hooks-nix.url = "github:cachix/git-hooks.nix";
sops-nix = { sops-nix = {
url = "github:Mic92/sops-nix"; url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
treefmt-nix.url = "github:numtide/treefmt-nix"; treefmt-nix.url = "github:numtide/treefmt-nix";
}; };
outputs = outputs =
inputs@{ flake-parts, ... }: inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } ( flake-parts.lib.mkFlake { inherit inputs; } (
@ -35,9 +35,10 @@
{ {
systems = [ "aarch64-linux" ]; systems = [ "aarch64-linux" ];
imports = [ imports = [
inputs.devshell.flakeModule
inputs.git-hooks-nix.flakeModule
inputs.home-manager.flakeModules.home-manager inputs.home-manager.flakeModules.home-manager
inputs.treefmt-nix.flakeModule inputs.treefmt-nix.flakeModule
inputs.devshell.flakeModule
# ./home/flake-module.nix # ./home/flake-module.nix
]; ];
flake = { flake = {
@ -107,7 +108,34 @@
pkgs.yaml-language-server pkgs.yaml-language-server
]; ];
}; };
treefmt = ./treefmt.nix; pre-commit.settings = {
hooks = {
markdownlint = {
enable = true;
};
vale = {
enable = true;
};
treefmt = {
enable = true;
};
};
};
treefmt = {
projectRootFile = "flake.nix";
programs = {
nixfmt = {
enable = true;
strict = true;
};
prettier = {
enable = true;
};
taplo = {
enable = true;
};
};
};
}; };
} }
); );

View file

@ -1,16 +0,0 @@
{ ... }:
{
projectRootFile = "flake.nix";
programs = {
nixfmt = {
enable = true;
strict = true;
};
prettier = {
enable = true;
};
taplo = {
enable = true;
};
};
}