diff options
author | Alan Pearce | 2024-05-20 18:12:23 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-20 18:12:23 +0200 |
commit | d0c2de9e762fb476b5cb53bb5129bf8af8cb9b45 (patch) | |
tree | b33480bc71bf1417b252b63a5c7d62590da32110 /nix/pre-commit-checks.nix | |
parent | 60a15699657cef86d1a644c0d13b0d117a818633 (diff) | |
download | searchix-d0c2de9e762fb476b5cb53bb5129bf8af8cb9b45.tar.lz searchix-d0c2de9e762fb476b5cb53bb5129bf8af8cb9b45.tar.zst searchix-d0c2de9e762fb476b5cb53bb5129bf8af8cb9b45.zip |
build: store default configuration in repo and ensure freshness
Diffstat (limited to 'nix/pre-commit-checks.nix')
-rw-r--r-- | nix/pre-commit-checks.nix | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/nix/pre-commit-checks.nix b/nix/pre-commit-checks.nix index bd6df7c..4858783 100644 --- a/nix/pre-commit-checks.nix +++ b/nix/pre-commit-checks.nix @@ -91,5 +91,19 @@ rec { entry = "${pkgs.gomod2nix}/bin/gomod2nix"; pass_filenames = false; }; + + generate-default-config = { + enable = true; + name = "generate-default-config"; + description = "Ensure default configuration file is up-to-date"; + files = "config.go$"; + entry = + let + script = pkgs.writeShellScript "generate-default-config" '' + ${pkgs.wgo}/bin/wgo run -exit searchix.go --print-default-config > defaults.toml + ''; + in + builtins.toString script; + }; }; } |