From 021d8694bfecd62d4510df2069b4bcbfbad6a0fb Mon Sep 17 00:00:00 2001 From: kirinnee Date: Wed, 29 Jan 2025 17:09:54 +0800 Subject: [PATCH] feat: use atomiutils, infrautils & infralint --- templates/bun/nix/env.nix | 16 +++-------- templates/bun/nix/packages.nix | 27 +++---------------- templates/bun/nix/pre-commit.nix | 6 ++--- templates/cyanprint-bun/nix/env.nix | 7 +---- templates/cyanprint-bun/nix/packages.nix | 8 +----- templates/cyanprint-bun/nix/pre-commit.nix | 2 +- templates/dotnet/nix/env.nix | 16 +++-------- templates/dotnet/nix/packages.nix | 28 +++----------------- templates/dotnet/nix/pre-commit.nix | 6 ++--- templates/go/nix/env.nix | 16 +++-------- templates/go/nix/packages.nix | 28 +++----------------- templates/go/nix/pre-commit.nix | 6 ++--- templates/normal/standard/nix/env.nix | 8 +----- templates/normal/standard/nix/packages.nix | 7 +---- templates/normal/standard/nix/pre-commit.nix | 2 +- 15 files changed, 33 insertions(+), 150 deletions(-) diff --git a/templates/bun/nix/env.nix b/templates/bun/nix/env.nix index d84f987..c5047bf 100644 --- a/templates/bun/nix/env.nix +++ b/templates/bun/nix/env.nix @@ -2,14 +2,7 @@ with packages; { system = [ - coreutils - findutils - gnugrep - gnused - bash - jq - yq - curl + atomiutils ]; dev = [ @@ -21,9 +14,7 @@ with packages; <%= if (infra) { %> */ infra = [ - kubectl - k3d - helm + infrautils ]; /* <%= } %> @@ -45,8 +36,7 @@ with packages; /* <%= if (infra) { %> */ - hadolint - helm-docs + infralint /* <%= } %> */ diff --git a/templates/bun/nix/packages.nix b/templates/bun/nix/packages.nix index ee87f0c..c20002f 100644 --- a/templates/bun/nix/packages.nix +++ b/templates/bun/nix/packages.nix @@ -17,28 +17,12 @@ let with pkgs-2411; { - yq = yq-go; - - /* - <%= if (infra) { %> - */ - helm = kubernetes-helm; - /* - <%= } %> - */ - inherit # standard - coreutils - findutils - gnugrep - gnused - jq - bash + atomiutils git - curl infisical treefmt @@ -52,13 +36,8 @@ let <%= if (infra) { %> */ #infra - kubectl - k3d - - docker - hadolint - - helm-docs + infrautils + infralint /* <%= } %> */ diff --git a/templates/bun/nix/pre-commit.nix b/templates/bun/nix/pre-commit.nix index 7656701..bd4617a 100644 --- a/templates/bun/nix/pre-commit.nix +++ b/templates/bun/nix/pre-commit.nix @@ -76,7 +76,7 @@ pre-commit-lib.run { a-enforce-exec = { enable = true; name = "Enforce Shell Script executable"; - entry = "${packages.coreutils}/bin/chmod +x"; + entry = "${packages.atomiutils}/bin/chmod +x"; files = ".*sh$"; language = "system"; pass_filenames = true; @@ -88,7 +88,7 @@ pre-commit-lib.run { a-hadolint = { enable = true; name = "Docker Linter"; - entry = "${packages.hadolint}/bin/hadolint"; + entry = "${packages.infralint}/bin/hadolint"; files = ".*Dockerfile$"; language = "system"; pass_filenames = true; @@ -97,7 +97,7 @@ pre-commit-lib.run { a-helm-docs = { enable = true; name = "Helm Docs"; - entry = "${packages.helm-docs}/bin/helm-docs"; + entry = "${packages.infralint}/bin/helm-docs"; files = ".*"; language = "system"; pass_filenames = false; diff --git a/templates/cyanprint-bun/nix/env.nix b/templates/cyanprint-bun/nix/env.nix index 5e44a5c..889b2a7 100644 --- a/templates/cyanprint-bun/nix/env.nix +++ b/templates/cyanprint-bun/nix/env.nix @@ -2,12 +2,7 @@ with packages; { system = [ - coreutils - findutils - gnugrep - gnused - jq - yq + atomiutils ]; dev = [ diff --git a/templates/cyanprint-bun/nix/packages.nix b/templates/cyanprint-bun/nix/packages.nix index 332c228..5ea5f77 100644 --- a/templates/cyanprint-bun/nix/packages.nix +++ b/templates/cyanprint-bun/nix/packages.nix @@ -16,15 +16,9 @@ let nix-2411 = ( with pkgs-2411; { - yq = yq-go; inherit - coreutils - findutils - gnugrep - gnused - jq - + atomiutils git diff --git a/templates/cyanprint-bun/nix/pre-commit.nix b/templates/cyanprint-bun/nix/pre-commit.nix index 01ba36d..084d674 100644 --- a/templates/cyanprint-bun/nix/pre-commit.nix +++ b/templates/cyanprint-bun/nix/pre-commit.nix @@ -57,7 +57,7 @@ pre-commit-lib.run { a-enforce-exec = { enable = true; name = "Enforce Shell Script executable"; - entry = "${packages.coreutils}/bin/chmod +x"; + entry = "${packages.atomiutils}/bin/chmod +x"; files = ".*sh$"; language = "system"; pass_filenames = true; diff --git a/templates/dotnet/nix/env.nix b/templates/dotnet/nix/env.nix index 3c03ba9..0d8d348 100644 --- a/templates/dotnet/nix/env.nix +++ b/templates/dotnet/nix/env.nix @@ -2,14 +2,7 @@ with packages; { system = [ - coreutils - findutils - gnugrep - gnused - bash - jq - yq - curl + atomiutils ]; dev = [ @@ -21,9 +14,7 @@ with packages; <%= if (infra) { %> */ infra = [ - kubectl - k3d - helm + infrautils ]; /* <%= } %> @@ -44,8 +35,7 @@ with packages; /* <%= if (infra) { %> */ - hadolint - helm-docs + infralint /* <%= } %> */ diff --git a/templates/dotnet/nix/packages.nix b/templates/dotnet/nix/packages.nix index fa1a01c..3df83e9 100644 --- a/templates/dotnet/nix/packages.nix +++ b/templates/dotnet/nix/packages.nix @@ -16,30 +16,13 @@ let nix-2411 = ( with pkgs-2411; { - - yq = yq-go; dotnet = dotnet-sdk_9; - - /* - <%= if (infra) { %> - */ - helm = kubernetes-helm; - /* - <%= } %> - */ - inherit # standard - coreutils - findutils - gnugrep - gnused - jq - bash + atomiutils git - curl infisical treefmt @@ -50,13 +33,8 @@ let <%= if (infra) { %> */ #infra - kubectl - k3d - - docker - hadolint - - helm-docs + infrautils + infralint /* <%= } %> */ diff --git a/templates/dotnet/nix/pre-commit.nix b/templates/dotnet/nix/pre-commit.nix index c7db7a3..20dbee8 100644 --- a/templates/dotnet/nix/pre-commit.nix +++ b/templates/dotnet/nix/pre-commit.nix @@ -77,7 +77,7 @@ pre-commit-lib.run { a-enforce-exec = { enable = true; name = "Enforce Shell Script executable"; - entry = "${packages.coreutils}/bin/chmod +x"; + entry = "${packages.atomiutils}/bin/chmod +x"; files = ".*sh$"; language = "system"; pass_filenames = true; @@ -89,7 +89,7 @@ pre-commit-lib.run { a-hadolint = { enable = true; name = "Docker Linter"; - entry = "${packages.hadolint}/bin/hadolint"; + entry = "${packages.infralint}/bin/hadolint"; files = ".*Dockerfile$"; language = "system"; pass_filenames = true; @@ -98,7 +98,7 @@ pre-commit-lib.run { a-helm-docs = { enable = true; name = "Helm Docs"; - entry = "${packages.helm-docs}/bin/helm-docs"; + entry = "${packages.infralint}/bin/helm-docs"; files = ".*"; language = "system"; pass_filenames = false; diff --git a/templates/go/nix/env.nix b/templates/go/nix/env.nix index 15ec63a..74f4d1a 100644 --- a/templates/go/nix/env.nix +++ b/templates/go/nix/env.nix @@ -2,14 +2,7 @@ with packages; { system = [ - coreutils - findutils - gnugrep - gnused - bash - jq - yq - curl + atomiutils ]; dev = [ @@ -22,9 +15,7 @@ with packages; <%= if (infra) { %> */ infra = [ - kubectl - k3d - helm + infrautils ]; /* <%= } %> @@ -49,8 +40,7 @@ with packages; /* <%= if (infra) { %> */ - hadolint - helm-docs + infralint /* <%= } %> */ diff --git a/templates/go/nix/packages.nix b/templates/go/nix/packages.nix index b530c98..7bb8000 100644 --- a/templates/go/nix/packages.nix +++ b/templates/go/nix/packages.nix @@ -16,29 +16,12 @@ let nix-2411 = ( with pkgs-2411; { - - yq = yq-go; - - /* - <%= if (infra) { %> - */ - helm = kubernetes-helm; - /* - <%= } %> - */ - inherit # standard - coreutils - findutils - gnugrep - gnused - jq - bash + atomiutils git - curl infisical treefmt @@ -55,13 +38,8 @@ let <%= if (infra) { %> */ #infra - kubectl - k3d - - docker - hadolint - - helm-docs + infrautils + infralint /* <%= } %> */ diff --git a/templates/go/nix/pre-commit.nix b/templates/go/nix/pre-commit.nix index 70d5119..d2cc374 100644 --- a/templates/go/nix/pre-commit.nix +++ b/templates/go/nix/pre-commit.nix @@ -77,7 +77,7 @@ pre-commit-lib.run { a-enforce-exec = { enable = true; name = "Enforce Shell Script executable"; - entry = "${packages.coreutils}/bin/chmod +x"; + entry = "${packages.atomiutils}/bin/chmod +x"; files = ".*sh$"; language = "system"; pass_filenames = true; @@ -89,7 +89,7 @@ pre-commit-lib.run { a-hadolint = { enable = true; name = "Docker Linter"; - entry = "${packages.hadolint}/bin/hadolint"; + entry = "${packages.infralint}/bin/hadolint"; files = ".*Dockerfile$"; language = "system"; pass_filenames = true; @@ -98,7 +98,7 @@ pre-commit-lib.run { a-helm-docs = { enable = true; name = "Helm Docs"; - entry = "${packages.helm-docs}/bin/helm-docs"; + entry = "${packages.infralint}/bin/helm-docs"; files = ".*"; language = "system"; pass_filenames = false; diff --git a/templates/normal/standard/nix/env.nix b/templates/normal/standard/nix/env.nix index 9836bbb..052bcb6 100644 --- a/templates/normal/standard/nix/env.nix +++ b/templates/normal/standard/nix/env.nix @@ -2,13 +2,7 @@ with packages; { system = [ - coreutils - findutils - gnugrep - gnused - bash - jq - yq + atomiutils ]; dev = [ diff --git a/templates/normal/standard/nix/packages.nix b/templates/normal/standard/nix/packages.nix index 80798e0..c32c7d8 100644 --- a/templates/normal/standard/nix/packages.nix +++ b/templates/normal/standard/nix/packages.nix @@ -19,12 +19,7 @@ let { yq = yq-go; inherit - coreutils - findutils - gnugrep - gnused - jq - bash + atomiutils git infisical treefmt diff --git a/templates/normal/standard/nix/pre-commit.nix b/templates/normal/standard/nix/pre-commit.nix index 4d63fa7..6ca6a34 100644 --- a/templates/normal/standard/nix/pre-commit.nix +++ b/templates/normal/standard/nix/pre-commit.nix @@ -67,7 +67,7 @@ pre-commit-lib.run { a-enforce-exec = { enable = true; name = "Enforce Shell Script executable"; - entry = "${packages.coreutils}/bin/chmod +x"; + entry = "${packages.atomiutils}/bin/chmod +x"; files = ".*sh$"; language = "system"; pass_filenames = true;