feat(shell): nf-lint-tf

This commit is contained in:
arcnmx 2024-01-16 11:02:55 -08:00
parent 47d1036c42
commit 4de65230b4
5 changed files with 26 additions and 5 deletions

View file

@ -1,10 +1,13 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib.options) mkOption;
inherit (lib.types) attrsOf package;
inherit (lib.meta) getExe;
cfg = config.outputs.packages;
in {
options.outputs.packages = mkOption {
type = attrsOf package;
@ -12,8 +15,13 @@ in {
};
config.outputs.packages = {
inherit (pkgs.buildPackages) terraform tflint;
nf-deploy = pkgs.writeShellScriptBin "nf-deploy" ''
exec ${pkgs.runtimeShell} ${../../ci/deploy.sh} "$@"
'';
nf-lint-tf = pkgs.writeShellScriptBin "nf-lint-tf" ''
${getExe cfg.terraform} fmt "$@" &&
${cfg.tflint}/bin/tflint
'';
};
}