From 1b6e95106183d2f47c52219623f5e65c1735e92e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 3 Aug 2023 16:45:53 +0200 Subject: [PATCH] simplify job-flake-updates --- pkgs/flake-module.nix | 12 ++---------- pkgs/job-flake-update-clan-core/default.nix | 7 ------- pkgs/job-flake-update-clan-homepage/default.nix | 10 ---------- pkgs/job-flake-update-clan-homepage/script.sh | 7 ------- pkgs/job-flake-update-clan-infra/default.nix | 10 ---------- pkgs/job-flake-update-clan-infra/script.sh | 7 ------- pkgs/job-flake-updates/default.nix | 16 ++++++++++++++++ .../script.sh | 0 8 files changed, 18 insertions(+), 51 deletions(-) delete mode 100644 pkgs/job-flake-update-clan-core/default.nix delete mode 100644 pkgs/job-flake-update-clan-homepage/default.nix delete mode 100644 pkgs/job-flake-update-clan-homepage/script.sh delete mode 100644 pkgs/job-flake-update-clan-infra/default.nix delete mode 100644 pkgs/job-flake-update-clan-infra/script.sh create mode 100644 pkgs/job-flake-updates/default.nix rename pkgs/{job-flake-update-clan-core => job-flake-updates}/script.sh (100%) diff --git a/pkgs/flake-module.nix b/pkgs/flake-module.nix index b28a0be..7529a66 100644 --- a/pkgs/flake-module.nix +++ b/pkgs/flake-module.nix @@ -20,18 +20,10 @@ inherit (config.writers) writePureShellScriptBin; inherit (config.packages) action-checkout action-ensure-tea-login action-create-pr action-flake-update; }; - job-flake-update-clan-core = pkgs.callPackage ./job-flake-update-clan-core { + inherit (pkgs.callPackages ./job-flake-updates { inherit (config.writers) writePureShellScriptBin; inherit (config.packages) action-flake-update-pr-clan; - }; - job-flake-update-clan-homepage = pkgs.callPackage ./job-flake-update-clan-homepage { - inherit (config.writers) writePureShellScriptBin; - inherit (config.packages) action-flake-update-pr-clan; - }; - job-flake-update-clan-infra = pkgs.callPackage ./job-flake-update-clan-infra { - inherit (config.writers) writePureShellScriptBin; - inherit (config.packages) action-flake-update-pr-clan; - }; + }) job-flake-update-clan-core job-flake-update-clan-homepage job-flake-update-clan-infra; }; }; } diff --git a/pkgs/job-flake-update-clan-core/default.nix b/pkgs/job-flake-update-clan-core/default.nix deleted file mode 100644 index dec9077..0000000 --- a/pkgs/job-flake-update-clan-core/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ bash -, action-flake-update-pr-clan -, writePureShellScriptBin -}: -writePureShellScriptBin "job-flake-update-clan-core" [ bash action-flake-update-pr-clan ] '' - bash ${./script.sh} -'' diff --git a/pkgs/job-flake-update-clan-homepage/default.nix b/pkgs/job-flake-update-clan-homepage/default.nix deleted file mode 100644 index 7e08117..0000000 --- a/pkgs/job-flake-update-clan-homepage/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ bash -, action-flake-update-pr-clan -, writePureShellScriptBin -}: -writePureShellScriptBin "job-flake-update-clan-homepage" [ - bash - action-flake-update-pr-clan -] '' - bash ${./script.sh} -'' diff --git a/pkgs/job-flake-update-clan-homepage/script.sh b/pkgs/job-flake-update-clan-homepage/script.sh deleted file mode 100644 index 92aa6b9..0000000 --- a/pkgs/job-flake-update-clan-homepage/script.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -export REPO="gitea@git.clan.lol:clan/clan-homepage.git" -export KEEP_VARS="REPO${KEEP_VARS:+ $KEEP_VARS}" - -action-flake-update-pr-clan diff --git a/pkgs/job-flake-update-clan-infra/default.nix b/pkgs/job-flake-update-clan-infra/default.nix deleted file mode 100644 index b0fd161..0000000 --- a/pkgs/job-flake-update-clan-infra/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ bash -, action-flake-update-pr-clan -, writePureShellScriptBin -}: -writePureShellScriptBin "job-flake-update-clan-infra" [ - bash - action-flake-update-pr-clan -] '' - bash ${./script.sh} -'' diff --git a/pkgs/job-flake-update-clan-infra/script.sh b/pkgs/job-flake-update-clan-infra/script.sh deleted file mode 100644 index c3c15b1..0000000 --- a/pkgs/job-flake-update-clan-infra/script.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -export REPO="gitea@git.clan.lol:clan/clan-infra.git" -export KEEP_VARS="REPO${KEEP_VARS:+ $KEEP_VARS}" - -action-flake-update-pr-clan diff --git a/pkgs/job-flake-updates/default.nix b/pkgs/job-flake-updates/default.nix new file mode 100644 index 0000000..cc5fcb7 --- /dev/null +++ b/pkgs/job-flake-updates/default.nix @@ -0,0 +1,16 @@ +{ action-flake-update-pr-clan +, writePureShellScriptBin +}: +let + job-flake-update = repo: writePureShellScriptBin "job-flake-update-${repo}" [ action-flake-update-pr-clan ] '' + export REPO="gitea@git.clan.lol:clan/${repo}.git" + export KEEP_VARS="REPO''${KEEP_VARS:+ $KEEP_VARS}" + + action-flake-update-pr-clan + ''; +in +{ + job-flake-update-clan-core = job-flake-update "clan-core"; + job-flake-update-clan-homepage = job-flake-update "clan-homepage"; + job-flake-update-clan-infra = job-flake-update "clan-infra"; +} diff --git a/pkgs/job-flake-update-clan-core/script.sh b/pkgs/job-flake-updates/script.sh similarity index 100% rename from pkgs/job-flake-update-clan-core/script.sh rename to pkgs/job-flake-updates/script.sh