From f3696ab0d6ba55429d1a7bc8a2257c0d1da0506c Mon Sep 17 00:00:00 2001 From: Alexander Tomokhov Date: Thu, 28 Dec 2023 20:16:33 +0400 Subject: [PATCH] embed CONFIG_URL and NIX_VERSION inside nixos-infect Now you need to edit nixos-infect to update base configuration URL. --- .drone.yml | 2 -- nixos-infect | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index faa5d02..70d41bd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -34,7 +34,6 @@ steps: trap 'echo \$LINENO: "\$BASH_COMMAND"; exit 1' ERR API_TOKEN="$USER_PASS" - CONFIG_URL=https://git.selfprivacy.org/api/v1/repos/SelfPrivacy/selfprivacy-nixos-template/archive/2569a42a73e359b21c7c86b4ee413fb435ec8db3.tar.gz DNS_PROVIDER_TOKEN=$CLOUDFLARE_TOKEN DNS_PROVIDER_TYPE=CLOUDFLARE DOMAIN=$DOMAIN @@ -42,7 +41,6 @@ steps: HOSTNAME=selfprivacy-ci-test LUSER=cicdcicd NIXOS_CONFIG_ID=default - NIX_VERSION=2.18.1 PROVIDER=HETZNER SSH_AUTHORIZED_KEY="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMBb3yVhYF4slhf1iQCiGLOVcbGKP/MmkQiEMl2un+4K" STAGING_ACME=true diff --git a/nixos-infect b/nixos-infect index ea03602..bf3d997 100755 --- a/nixos-infect +++ b/nixos-infect @@ -6,14 +6,12 @@ # mandatory variables : "${API_TOKEN:?API_TOKEN variable is not set}" -: "${CONFIG_URL:?CONFIG_URL variable is not set}" : "${DNS_PROVIDER_TOKEN:?DNS_PROVIDER_TOKEN variable is not set}" : "${DNS_PROVIDER_TYPE:?DNS_PROVIDER_TYPE variable is not set}" : "${DOMAIN:?DOMAIN variable is not set}" : "${ENCODED_PASSWORD:?ENCODED_PASSWORD variable is not set}" : "${HOSTNAME:?HOSTNAME variable is not set}" : "${LUSER:?LUSER variable is not set}" -: "${NIX_VERSION:?NIX_VERSION variable is not set}" : "${PROVIDER:?PROVIDER variable is not set}" # optional variables @@ -22,6 +20,9 @@ : "${VOLUME_DEV_PATH:=}" : "${STAGING_ACME:=false}" +readonly CONFIG_URL="https://git.selfprivacy.org/api/v1/repos/SelfPrivacy/selfprivacy-nixos-template/archive/2569a42a73e359b21c7c86b4ee413fb435ec8db3.tar.gz" +readonly NIX_VERSION="2.18.1" + readonly NL=$'\n' readonly LOCAL_FLAKE_DIR="/etc/nixos" readonly SECRETS_FILEPATH="/etc/selfprivacy/secrets.json"