14 Commits

Author SHA1 Message Date
a5473b700f +hostname setting 2025-04-11 10:22:34 +02:00
8adf63860c +hostname setting 2025-04-11 10:22:20 +02:00
be9f216f4c +hostname setting 2025-04-11 10:05:58 +02:00
1980fa4178 +hostname setting 2025-04-11 10:00:48 +02:00
81b2811569 +hostname setting 2025-04-11 09:45:32 +02:00
f48ac1c9ae +hostname setting 2025-04-11 09:36:53 +02:00
1405f80bfc fix deploy input 2025-04-10 16:03:08 +02:00
2bd4bdbd1d fix deploy input 2025-04-10 16:02:51 +02:00
9d3abd60fc fix deploy input 2025-04-10 16:00:54 +02:00
412bc59408 fix systemrebuild on add services 2025-04-10 14:43:19 +02:00
40d32b7133 fix systemrebuild on add services 2025-04-10 13:56:42 +02:00
9a258602a2 Basic config input update 2025-04-10 13:25:37 +02:00
ae316fb7f6 Basic config input update 2025-04-10 13:00:36 +02:00
fc512b0248 Bugfix installer: SSH config port 2025-04-10 12:46:24 +02:00
5 changed files with 34 additions and 106 deletions

110
flake.lock generated
View File

@ -6,43 +6,25 @@
"nixpkgs-unstable": "nixpkgs-unstable" "nixpkgs-unstable": "nixpkgs-unstable"
}, },
"locked": { "locked": {
"lastModified": 1744363797, "lastModified": 1744286132,
"narHash": "sha256-Zn8TIOonPBQojN5NZ9Q+y6hvwAKFvW+iLXiceGNQ40o=", "narHash": "sha256-b+QaraEq2KS6X3PeAcm2J0afIQjvUEJ61Oj1OHiELzA=",
"ref": "stable", "ref": "stable",
"rev": "45622da8ac40d404e59fa1eff9f63e42b7b95e2b", "rev": "dd405780a03515688101b0b66c8757ce817f1ad7",
"revCount": 10, "revCount": 9,
"type": "git", "type": "git",
"url": "https://code.m3ta.dev/m3tam3re/self-host-playbook-base" "url": "https://code.m3tam3re.com/m3tam3re/self-host-playbook-base"
}, },
"original": { "original": {
"ref": "stable", "ref": "stable",
"type": "git", "type": "git",
"url": "https://code.m3ta.dev/m3tam3re/self-host-playbook-base" "url": "https://code.m3tam3re.com/m3tam3re/self-host-playbook-base"
}
},
"deploy-rs": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": "nixpkgs_2",
"utils": "utils"
},
"locked": {
"lastModified": 1727447169,
"narHash": "sha256-3KyjMPUKHkiWhwR91J1YchF6zb6gvckCAY1jOE+ne0U=",
"owner": "serokell",
"repo": "deploy-rs",
"rev": "aa07eb05537d4cd025e2310397a6adcedfe72c76",
"type": "github"
},
"original": {
"owner": "serokell",
"repo": "deploy-rs",
"type": "github"
} }
}, },
"disko": { "disko": {
"inputs": { "inputs": {
"nixpkgs": ["nixpkgs"] "nixpkgs": [
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1744145203, "lastModified": 1744145203,
@ -58,22 +40,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1741600792, "lastModified": 1741600792,
@ -106,61 +72,17 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1702272962,
"narHash": "sha256-D+zHwkwPc6oYQ4G3A1HuadopqRwUY/JkMwHz1YF7j4Q=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"base-config": "base-config", "base-config": "base-config",
"deploy-rs": "deploy-rs", "deploy-rs": [
"nixpkgs"
],
"disko": "disko", "disko": "disko",
"nixpkgs": ["base-config", "nixpkgs"] "nixpkgs": [
} "base-config",
}, "nixpkgs"
"systems": { ]
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
} }
} }
}, },

View File

@ -4,7 +4,7 @@
inputs = { inputs = {
base-config = { base-config = {
# url = "path:/home/m3tam3re/p/nix/self-host-playbook-base"; # url = "path:/home/m3tam3re/p/nix/self-host-playbook-base";
url = "git+https://code.m3ta.dev/m3tam3re/self-host-playbook-base?ref=stable"; url = "git+https://code.m3tam3re.com/m3tam3re/self-host-playbook-base?ref=stable";
}; };
nixpkgs = { nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-24.11"; url = "github:NixOS/nixpkgs/nixos-24.11";
@ -28,7 +28,7 @@
} @ inputs: let } @ inputs: let
jsonConfig = builtins.fromJSON (builtins.readFile ./config.json); jsonConfig = builtins.fromJSON (builtins.readFile ./config.json);
in { in {
nixosConfigurations.${jsonConfig.hostname} = nixpkgs.lib.nixosSystem { nixosConfigurations.server = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
(base-config.nixosModules.default { (base-config.nixosModules.default {
@ -50,7 +50,7 @@
interactiveSudo = true; interactiveSudo = true;
path = path =
deploy-rs.lib.x86_64-linux.activate.nixos deploy-rs.lib.x86_64-linux.activate.nixos
self.nixosConfigurations.${jsonConfig.hostname}; self.nixosConfigurations.server;
}; };
}; };
}; };

View File

@ -50,7 +50,7 @@ fi
get_latest_version() { get_latest_version() {
local LATEST_VERSION local LATEST_VERSION
latest_version=$(curl -s "https://code.m3ta.dev/api/v1/repos/m3tam3re/self-host-playbook/tags" | jq -r '.[] | select(.name | startswith("v")) | .name' | sort -V | tail -n1) latest_version=$(curl -s "https://code.m3tam3re.com/api/v1/repos/m3tam3re/self-host-playbook/tags" | jq -r '.[] | select(.name | startswith("v")) | .name' | sort -V | tail -n1)
if [ -z "$latest_version" ]; then if [ -z "$latest_version" ]; then
echo "❌ Error: Could not fetch latest version from repository" echo "❌ Error: Could not fetch latest version from repository"
@ -83,7 +83,7 @@ setup_latest_version() {
mkdir -p "$CLONE_DIR" mkdir -p "$CLONE_DIR"
# Clone to temporary directory with --quiet flag # Clone to temporary directory with --quiet flag
if ! nix flake clone --quiet "git+https://code.m3ta.dev/m3tam3re/self-host-playbook?ref=v${target_version}" --dest "$CLONE_DIR" 2>/dev/null; then if ! nix flake clone --quiet "git+https://code.m3tam3re.com/m3tam3re/self-host-playbook?ref=v${target_version}" --dest "$CLONE_DIR" 2>/dev/null; then
echo "❌ Failed to clone repository" echo "❌ Failed to clone repository"
return 1 return 1
fi fi
@ -424,8 +424,7 @@ cat > config.json << EOF
"baserow": "$BASEROW_DOMAIN" "baserow": "$BASEROW_DOMAIN"
}, },
"rootDevice": "$DEVICE_NAME", "rootDevice": "$DEVICE_NAME",
"ipAddress": "$IP_ADDRESS", "ipAddress": "$IP_ADDRESS"
"hostname": "$HOSTNAME"
} }
EOF EOF

View File

@ -28,7 +28,7 @@ get_current_version() {
get_latest_version() { get_latest_version() {
local latest_version local latest_version
latest_version=$(curl -s "https://code.m3ta.dev/api/v1/repos/m3tam3re/self-host-playbook/tags" | jq -r '.[] | select(.name | startswith("v")) | .name' | sort -V | tail -n1) latest_version=$(curl -s "https://code.m3tam3re.com/api/v1/repos/m3tam3re/self-host-playbook/tags" | jq -r '.[] | select(.name | startswith("v")) | .name' | sort -V | tail -n1)
if [ -z "$latest_version" ]; then if [ -z "$latest_version" ]; then
echo "❌ Error: Could not fetch latest version from repository" echo "❌ Error: Could not fetch latest version from repository"
@ -51,7 +51,7 @@ check_compatibility() {
fi fi
local min_compatible_version local min_compatible_version
min_compatible_version=$(curl -s "https://code.m3ta.dev/m3tam3re/self-host-playbook/raw/branch/develop/v${target_version}/$version_file" | jq -r '.minCompatibleVersion') min_compatible_version=$(curl -s "https://code.m3tam3re.com/m3tam3re/self-host-playbook/raw/branch/develop/v${target_version}/$version_file" | jq -r '.minCompatibleVersion')
if version_lt "$current_version" "$min_compatible_version"; then if version_lt "$current_version" "$min_compatible_version"; then
echo "❌ Your current version ($current_version) is too old for direct upgrade." echo "❌ Your current version ($current_version) is too old for direct upgrade."
@ -71,7 +71,7 @@ show_changelog() {
echo "------------------------------------------------" echo "------------------------------------------------"
local changelog local changelog
changelog=$(curl -s "https://code.m3ta.dev/m3tam3re/self-host-playbook/raw/branch/develop/v${target_version}/$version_file" | jq -r '.changelog') changelog=$(curl -s "https://code.m3tam3re.com/m3tam3re/self-host-playbook/raw/branch/develop/v${target_version}/$version_file" | jq -r '.changelog')
# Process each version once, then all its changes # Process each version once, then all its changes
echo "$changelog" | jq -r --arg cv "$current_version" --arg tv "$target_version" ' echo "$changelog" | jq -r --arg cv "$current_version" --arg tv "$target_version" '
@ -87,6 +87,13 @@ perform_update() {
local target_version=$1 local target_version=$1
local backup_dir=$2 local backup_dir=$2
# Ensure we're in the correct directory
local current_dir=$(basename "$(pwd)")
if [ "$current_dir" != "self-host-playbook" ]; then
echo "❌ Error: Must be in 'self-host-playbook' directory"
return 1
fi
# Verify essential files exist before proceeding # Verify essential files exist before proceeding
if [ ! -f "config.json" ] || [ ! -d "env" ]; then if [ ! -f "config.json" ] || [ ! -d "env" ]; then
echo "❌ Error: Essential files missing. Are you in the correct directory?" echo "❌ Error: Essential files missing. Are you in the correct directory?"
@ -103,7 +110,7 @@ perform_update() {
mkdir -p "$CLONE_DIR" mkdir -p "$CLONE_DIR"
# Clone to temporary directory with --quiet flag # Clone to temporary directory with --quiet flag
if ! nix flake clone --quiet "git+https://code.m3ta.dev/m3tam3re/self-host-playbook?ref=v${target_version}" --dest "$CLONE_DIR" 2>/dev/null; then if ! nix flake clone --quiet "git+https://code.m3tam3re.com/m3tam3re/self-host-playbook?ref=v${target_version}" --dest "$CLONE_DIR" 2>/dev/null; then
echo "❌ Failed to clone repository" echo "❌ Failed to clone repository"
return 1 return 1
fi fi

View File

@ -1,7 +1,7 @@
{ {
"version": "0.1.0", "version": "0.1.0",
"minCompatibleVersion": "0.0.0", "minCompatibleVersion": "0.0.0",
"updateUrl": "https://code.m3ta.dev/m3tam3re/self-host-playbook", "updateUrl": "https://code.m3tam3re.com/m3tam3re/self-host-playbook",
"changelog": { "changelog": {
"0.1.0": [ "0.1.0": [
"Added a management CLI for easily adding custom services.", "Added a management CLI for easily adding custom services.",