summaryrefslogtreecommitdiff
path: root/templates/full/nix/flake/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'templates/full/nix/flake/default.nix')
-rw-r--r--templates/full/nix/flake/default.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/templates/full/nix/flake/default.nix b/templates/full/nix/flake/default.nix
new file mode 100644
index 0000000..4402a16
--- /dev/null
+++ b/templates/full/nix/flake/default.nix
@@ -0,0 +1,43 @@
+{
+ inputs,
+ self,
+ ...
+}: {
+ perSystem = {
+ pkgs,
+ system,
+ ...
+ }: {
+ checks = {
+ pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
+ src = builtins.path {
+ name = "flake-src";
+ path = ../../.;
+ };
+
+ hooks = {
+ alejandra.enable = true;
+ deadnix.enable = true;
+ nil.enable = true;
+ statix.enable = true;
+ };
+ };
+ };
+
+ devShells = let
+ inherit (pkgs) mkShell;
+ in {
+ default = mkShell {
+ inherit (self.checks.${system}.pre-commit-check) shellHook;
+ packages = with pkgs; [
+ alejandra
+ deadnix
+ nil
+ statix
+ ];
+ };
+ };
+
+ formatter = pkgs.alejandra;
+ };
+}