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" 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" 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