From 1f93db72bc8c0b520effbade676530371dc53639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 1 Jul 2024 14:06:57 +0200 Subject: [PATCH 1/3] drop nixosify --- terraform/web01/nixosify.sh | 78 ------------------------------------- 1 file changed, 78 deletions(-) delete mode 100644 terraform/web01/nixosify.sh diff --git a/terraform/web01/nixosify.sh b/terraform/web01/nixosify.sh deleted file mode 100644 index bea7cf4..0000000 --- a/terraform/web01/nixosify.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh - -# shellcheck disable=SC1091 - -set -eu - -installNix() { - if ! command -v nix >/dev/null; then - echo "Installing Nix..." - trap 'rm -f /tmp/nix-install' EXIT - if command -v curl; then - curl -L https://nixos.org/nix/install >/tmp/nix-install - elif command -v wget; then - wget -O /tmp/nix-install https://nixos.org/nix/install - else - echo "Please install curl or wget" - exit 1 - fi - sh /tmp/nix-install --daemon --yes - fi - set +u - . /etc/profile - set -u -} - -patchOsRelease() { - cat >/etc/os-release < {}; -buildEnv { - name = "install-tools"; - paths = [ - nix - nixos-install-tools - parted - mdadm - xfsprogs - dosfstools - btrfs-progs - e2fsprogs - jq - util-linux - ]; -} -EOF - ) - tools=$(nix-build --no-out-link -E "$env") - - # check if /usr/local/bin is in PATH - if ! echo "$PATH" | grep -q /usr/local/bin; then - echo "WARNING: /usr/local/bin is not in PATH" >&2 - fi - - mkdir -p /usr/local/bin - for i in "$tools/bin/"*; do - ln -sf "$i" /usr/local/bin - done -} - -applyHetznerZfsQuirk() { - if test -f /etc/hetzner-build; then - # Hetzner has dummy binaries here for zfs, - # however those won't work and even crashed the system. - rm -f /usr/local/sbin/zfs /usr/local/sbin/zpool /usr/local/sbin/zdb - fi -} - -installNix -patchOsRelease -installTools -applyHetznerZfsQuirk From 27f4204a5f60831b28760e2611f8edda2efb0c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 1 Jul 2024 14:07:44 +0200 Subject: [PATCH 2/3] targets/web01/decrypt.sh: add shell directive for shellcheck --- targets/web01/decrypt.sh | 1 + targets/web01/deploy.sh | 1 + terraform/web01/install.sh | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/targets/web01/decrypt.sh b/targets/web01/decrypt.sh index d712ff2..63b9eb9 100755 --- a/targets/web01/decrypt.sh +++ b/targets/web01/decrypt.sh @@ -1,5 +1,6 @@ #!/usr/bin/env nix-shell #!nix-shell -i bash -p coreutils sops openssh +# shellcheck shell=bash # shellcheck disable=SC1008,SC1128 diff --git a/targets/web01/deploy.sh b/targets/web01/deploy.sh index 1895473..f4626e4 100755 --- a/targets/web01/deploy.sh +++ b/targets/web01/deploy.sh @@ -1,5 +1,6 @@ #!/usr/bin/env nix-shell #!nix-shell -i bash -p nix jq bash rsync +# shellcheck shell=bash # shellcheck disable=SC1008,SC1128 diff --git a/terraform/web01/install.sh b/terraform/web01/install.sh index 63d5cf2..0b9a6d3 100644 --- a/terraform/web01/install.sh +++ b/terraform/web01/install.sh @@ -1,8 +1,8 @@ #!/usr/bin/env nix-shell #!nix-shell -i bash -p coreutils sops openssh nix +# shellcheck shell=bash # shellcheck disable=SC1008,SC1128 -set -euox pipefail if [[ -z "${HOST:-}" ]]; then echo "HOST is not set" From 6fe30e619beb56ef53b02e1ef5d75db3880dcfc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 1 Jul 2024 14:09:25 +0200 Subject: [PATCH 3/3] pkgs/action-flake-update-pr-clan: fix shellcheck linter errors --- pkgs/action-flake-update-pr-clan/script.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/action-flake-update-pr-clan/script.sh b/pkgs/action-flake-update-pr-clan/script.sh index 17cb806..6d7397b 100644 --- a/pkgs/action-flake-update-pr-clan/script.sh +++ b/pkgs/action-flake-update-pr-clan/script.sh @@ -5,10 +5,10 @@ set -euo pipefail export KEEP_VARS="GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GITEA_URL GITEA_USER PR_TITLE REMOTE_BRANCH REPO_DIR${KEEP_VARS:+ $KEEP_VARS}" # configure variables for actions -PR_TITLE="Automatic flake update - $(date --iso-8601=minutes)" -export PR_TITLE -REMOTE_BRANCH="flake-update-$(date --iso-8601)" -export REMOTE_BRANCH +today=$(date --iso-8601) +today_minutes=$(date --iso-8601=minutes) +export PR_TITLE="Automatic flake update - ${today_minutes}" +export REMOTE_BRANCH="flake-update-${today}" export REPO_DIR=$TMPDIR/repo export GIT_AUTHOR_NAME="Clan Merge Bot" export GIT_AUTHOR_EMAIL="clan-bot@git.clan.lol"