Compare commits
No commits in common. "a784b129627283c6bb313c480c14360da473af8a" and "7b7bcac73aa3c176605781ac912e85effaeb086b" have entirely different histories.
a784b12962
...
7b7bcac73a
7 changed files with 9 additions and 71 deletions
|
|
@ -1,44 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
# Check for hostname argument
|
|
||||||
if [[ $# -ne 1 ]]; then
|
|
||||||
echo "Usage: $0 <nixos-hostname>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
HOST="$1"
|
|
||||||
REPO_PATH="git+file://$PWD"
|
|
||||||
|
|
||||||
CURRENT_COMMIT=$(git rev-parse HEAD)
|
|
||||||
PREV_COMMIT=$(git rev-parse HEAD^)
|
|
||||||
|
|
||||||
# Check if the host exists at the current commit
|
|
||||||
if ! nix eval --quiet --expr "
|
|
||||||
let
|
|
||||||
flake = builtins.getFlake \"${REPO_PATH}?rev=${CURRENT_COMMIT}\";
|
|
||||||
in
|
|
||||||
builtins.hasAttr \"${HOST}\" flake.nixosConfigurations
|
|
||||||
"; then
|
|
||||||
echo "Error: Host '${HOST}' not found in nixosConfigurations at HEAD."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Now check for derivation change
|
|
||||||
RESULT=$(nix eval --raw --expr "
|
|
||||||
let
|
|
||||||
flake = builtins.getFlake;
|
|
||||||
prev = flake \"${REPO_PATH}?rev=${PREV_COMMIT}\";
|
|
||||||
curr = flake \"${REPO_PATH}?rev=${CURRENT_COMMIT}\";
|
|
||||||
in
|
|
||||||
if prev.nixosConfigurations.\"${HOST}\".config.system.build.toplevel !=
|
|
||||||
curr.nixosConfigurations.\"${HOST}\".config.system.build.toplevel
|
|
||||||
then \"changed\" else \"unchanged\"
|
|
||||||
")
|
|
||||||
|
|
||||||
# Output result
|
|
||||||
if [[ $RESULT == "changed" ]]; then
|
|
||||||
echo "System derivation changed for host '${HOST}' — deploy!"
|
|
||||||
else
|
|
||||||
echo "No change for host '${HOST}' — skip deployment."
|
|
||||||
fi
|
|
||||||
|
|
@ -18,6 +18,9 @@ in
|
||||||
deploy = {
|
deploy = {
|
||||||
enable = false;
|
enable = false;
|
||||||
};
|
};
|
||||||
|
services = {
|
||||||
|
tty-ips.enable = true;
|
||||||
|
};
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "base";
|
hostName = "base";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
{
|
|
||||||
flake,
|
|
||||||
modulesPath,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (flake) inputs;
|
|
||||||
inherit (inputs) self;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
self.nixosModules.default
|
|
||||||
"${modulesPath}/virtualisation/lxc-container.nix"
|
|
||||||
];
|
|
||||||
deploy = {
|
|
||||||
address = "unknown.local";
|
|
||||||
};
|
|
||||||
networking = {
|
|
||||||
hostName = "caddy";
|
|
||||||
};
|
|
||||||
environment.systemPackages = [
|
|
||||||
];
|
|
||||||
system.stateVersion = "25.05";
|
|
||||||
}
|
|
||||||
|
|
@ -61,6 +61,9 @@ in
|
||||||
deploy = {
|
deploy = {
|
||||||
address = "201:ea26:66c7:657b:3599:63a6:c66c:d388";
|
address = "201:ea26:66c7:657b:3599:63a6:c66c:d388";
|
||||||
};
|
};
|
||||||
|
services = {
|
||||||
|
tty-ips.enable = true;
|
||||||
|
};
|
||||||
networking = {
|
networking = {
|
||||||
firewall.enable = lib.mkForce false;
|
firewall.enable = lib.mkForce false;
|
||||||
hostName = "forgejo-runner-tofu";
|
hostName = "forgejo-runner-tofu";
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ in
|
||||||
address = "200:b938:d405:92df:a6e:1ffd:5213:26b";
|
address = "200:b938:d405:92df:a6e:1ffd:5213:26b";
|
||||||
};
|
};
|
||||||
services = {
|
services = {
|
||||||
|
tty-ips.enable = true;
|
||||||
uptime-kuma = {
|
uptime-kuma = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
tty-ips.enable = true;
|
||||||
otf = {
|
otf = {
|
||||||
enable = true;
|
enable = true;
|
||||||
environment = {
|
environment = {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ in
|
||||||
options.services.tty-ips = {
|
options.services.tty-ips = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = true;
|
default = false;
|
||||||
description = "Show interface IPs in TTY login using a dynamic issue file.";
|
description = "Show interface IPs in TTY login using a dynamic issue file.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue