From 72f9fad9eb6a5168d7201f56ec450e78674f45f5 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Mon, 7 Jul 2025 00:33:05 +0800 Subject: [PATCH] feat(git): add .gitignore and pre-commit config to gitignore --- .gitignore | 2 ++ nix/files/gitignore.nix | 13 +++++++++++++ nix/modules/flake/git-hooks.nix | 1 + 3 files changed, 16 insertions(+) create mode 100644 .gitignore create mode 100644 nix/files/gitignore.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..de901db --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# gitignore +.pre-commit-config.* \ No newline at end of file diff --git a/nix/files/gitignore.nix b/nix/files/gitignore.nix new file mode 100644 index 0000000..a35e3ee --- /dev/null +++ b/nix/files/gitignore.nix @@ -0,0 +1,13 @@ +{ config, ... }: +{ + perSystem = + { pkgs, ... }: + { + files.files = [ + { + path_ = ".gitignore"; + drv = pkgs.writeText ".gitignore" config.text.gitignore; + } + ]; + }; +} diff --git a/nix/modules/flake/git-hooks.nix b/nix/modules/flake/git-hooks.nix index a2bc1c0..d17bcce 100644 --- a/nix/modules/flake/git-hooks.nix +++ b/nix/modules/flake/git-hooks.nix @@ -1,6 +1,7 @@ { inputs, ... }: { imports = [ inputs.git-hooks.flakeModule ]; + text.gitignore = ".pre-commit-config.*"; perSystem = psArgs: { pre-commit.settings.hooks = { # Nix Linters