Skip to content

Commit

Permalink
Merge pull request #212 from nialov/feat-add-sops-pre-commit
Browse files Browse the repository at this point in the history
Add pre-commit-hook-ensure-sops
  • Loading branch information
domenkozar authored Jul 18, 2023
2 parents 87589fa + f189105 commit eb433bf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions modules/hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,20 @@ in
"${binPath} ${lib.optionalString write "--write"} ${lib.optionalString (output != null) "--${output}"} --ignore-unknown";
types = [ "text" ];
};
pre-commit-hook-ensure-sops = {
name = "pre-commit-hook-ensure-sops";
entry =
## NOTE: pre-commit-hook-ensure-sops landed in nixpkgs on 8 July 2022. Once it reaches a
## release of NixOS, the `throwIf` piece of code below will become
## useless.
lib.throwIf
(tools.pre-commit-hook-ensure-sops == null)
"The version of nixpkgs used by pre-commit-hooks.nix does not have the `pre-commit-hook-ensure-sops` package. Please use a more recent version of nixpkgs."
''
${tools.pre-commit-hook-ensure-sops}/bin/pre-commit-hook-ensure-sops
'';
files = lib.mkDefault "^secrets";
};
hunspell =
{
name = "hunspell";
Expand Down
2 changes: 2 additions & 0 deletions nix/tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
, opam
, ormolu
, pkgsBuildBuild
, pre-commit-hook-ensure-sops ? null
, python39Packages
, ruff ? null
, runCommand
Expand Down Expand Up @@ -100,6 +101,7 @@ in
nixpkgs-fmt
opam
ormolu
pre-commit-hook-ensure-sops
revive
ruff
rustfmt
Expand Down

0 comments on commit eb433bf

Please sign in to comment.