Mic92-main #199
@ -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}"
|
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
|
# configure variables for actions
|
||||||
PR_TITLE="Automatic flake update - $(date --iso-8601=minutes)"
|
today=$(date --iso-8601)
|
||||||
export PR_TITLE
|
today_minutes=$(date --iso-8601=minutes)
|
||||||
REMOTE_BRANCH="flake-update-$(date --iso-8601)"
|
export PR_TITLE="Automatic flake update - ${today_minutes}"
|
||||||
export REMOTE_BRANCH
|
export REMOTE_BRANCH="flake-update-${today}"
|
||||||
export REPO_DIR=$TMPDIR/repo
|
export REPO_DIR=$TMPDIR/repo
|
||||||
export GIT_AUTHOR_NAME="Clan Merge Bot"
|
export GIT_AUTHOR_NAME="Clan Merge Bot"
|
||||||
export GIT_AUTHOR_EMAIL="clan-bot@git.clan.lol"
|
export GIT_AUTHOR_EMAIL="clan-bot@git.clan.lol"
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell -i bash -p coreutils sops openssh
|
#!nix-shell -i bash -p coreutils sops openssh
|
||||||
|
# shellcheck shell=bash
|
||||||
|
|
||||||
# shellcheck disable=SC1008,SC1128
|
# shellcheck disable=SC1008,SC1128
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell -i bash -p nix jq bash rsync
|
#!nix-shell -i bash -p nix jq bash rsync
|
||||||
|
# shellcheck shell=bash
|
||||||
|
|
||||||
# shellcheck disable=SC1008,SC1128
|
# shellcheck disable=SC1008,SC1128
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell -i bash -p coreutils sops openssh nix
|
#!nix-shell -i bash -p coreutils sops openssh nix
|
||||||
|
|
||||||
|
# shellcheck shell=bash
|
||||||
# shellcheck disable=SC1008,SC1128
|
# shellcheck disable=SC1008,SC1128
|
||||||
set -euox pipefail
|
|
||||||
|
|
||||||
if [[ -z "${HOST:-}" ]]; then
|
if [[ -z "${HOST:-}" ]]; then
|
||||||
echo "HOST is not set"
|
echo "HOST is not set"
|
||||||
|
@ -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 <<EOF
|
|
||||||
ID=nixos
|
|
||||||
VARIANT_ID=installer
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
installTools() {
|
|
||||||
env=$(
|
|
||||||
cat <<EOF
|
|
||||||
with import <nixpkgs> {};
|
|
||||||
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
|
|
Loading…
Reference in New Issue
Block a user