From a9a6888958ed228597517bd2e8289326203b651b Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Tue, 13 May 2025 08:52:38 +0200 Subject: [PATCH] chore: rebuild devenv --- .envrc | 2 ++ .gitignore | 3 +++ .pre-commit-config.yaml | 27 --------------------------- devenv.nix | 14 ++++++++++++-- 4 files changed, 17 insertions(+), 29 deletions(-) delete mode 100644 .pre-commit-config.yaml diff --git a/.envrc b/.envrc index 30da14f..e3c2943 100644 --- a/.envrc +++ b/.envrc @@ -2,4 +2,6 @@ export DIRENV_WARN_TIMEOUT=20s eval "$(devenv direnvrc)" +# The use_devenv function supports passing flags to the devenv command +# For example: use devenv --impure --option services.postgres.enable:bool true use devenv diff --git a/.gitignore b/.gitignore index 785767a..47f7f20 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ devenv.local.nix # direnv .direnv + +# pre-commit +.pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 87f991d..0000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# See https://pre-commit.com for more information -# See https://pre-commit.com/hooks.html for more hooks -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-yaml - - id: check-added-large-files - - id: detect-private-key - - id: mixed-line-ending - - - repo: https://github.com/commitizen-tools/commitizen - rev: v3.27.0 - hooks: - - id: commitizen - stages: [commit-msg] - - - repo: local - hooks: - - id: home-manager-check - name: Home Manager Config Check - entry: home-manager switch --dry-run - language: system - pass_filenames: false - exclude: ^docs/ diff --git a/devenv.nix b/devenv.nix index a7d2560..0b21fb3 100644 --- a/devenv.nix +++ b/devenv.nix @@ -1,7 +1,8 @@ -{ pkgs, ... }: +{ ... }: { - git-hooks.hooks = { + git-hooks = { + hooks = { check-case-conflicts.enable = true; check-merge-conflicts.enable = true; commitizen.enable = true; @@ -10,4 +11,13 @@ markdownlint.enable = true; mdformat.enable = true; }; + + hooks.home-manager-check = { + enable = true; + name = "Home Manager Config Check"; + entry = "home-manager switch --dry-run"; + pass_filenames = false; + excludes = [ "^docs/" ]; + }; + }; }