rename nodes and add runner for gitea instance

This commit is contained in:
shobu 2025-11-11 21:05:47 +01:00
parent c610ce80bc
commit 542034054c
34 changed files with 69 additions and 24 deletions

View File

@ -69,32 +69,30 @@
};
};
sin = {
thea = {name, nodes, pkgs, ...}: {
imports = [
./hosts/n100/configuration.nix
./hosts/n100/hardware-configuration.nix
./hosts/${name}/configuration.nix
./hosts/${name}/hardware-configuration.nix
] ++ [
# modules
./modules/gitea/n100
./modules/gitea/${name}
];
deployment.targetHost = "n100.homelab.local";
deployment.targetHost = "thea.homelab.local";
};
zimablade = {
sin = {name, nodes, pkgs, ...}: {
imports = [
disko.nixosModules.disko
agenix.nixosModules.default
./hosts/zimablade/configuration.nix
./hosts/zimablade/hardware-configuration.nix
./hosts/${name}/configuration.nix
./hosts/${name}/hardware-configuration.nix
] ++ [
# modules
./modules/gitea/zimablade
./modules/gitea/${name}
];
deployment.targetHost = "zimablade.homelab.local";
# deployment.targetHost = "10.0.0.4";
# deployment.targetPort = 22223;
deployment.targetHost = "sin.homelab.local";
};
};
devShells = forEachSupportedSystem ({ pkgs }: {

View File

@ -2,5 +2,5 @@ $ORIGIN homelab.local.
@ IN SOA dns.homelab.local. shobu_serhao.proton.me. 2502011720 7200 3600 1209600 3600
dns IN A 10.0.0.5
n100 IN A 10.0.0.5
zimablade IN A 10.0.0.4
thea IN A 10.0.0.5
sin IN A 10.0.0.4

View File

@ -20,14 +20,14 @@
boot.loader.efi.canTouchEfiVariables = true;
networking = {
hostName = "n100"; # Define your hostname.
hostName = "thea"; # Define your hostname.
nameservers = [ "10.0.0.4" ];
dhcpcd.extraConfig = "nohook resolv.conf";
firewall = {
allowedTCPPorts = [ nodes.zimablade.config.services.gitea.settings.server.SSH_PORT ];
allowedTCPPorts = [ nodes.sin.config.services.gitea.settings.server.SSH_PORT ];
};
nat = {
enable = true;
@ -35,7 +35,7 @@
externalInterface = "enp1s0";
forwardPorts = [ {
# TODO refactor this in the gitea/n100 module
sourcePort = nodes.zimablade.config.services.gitea.settings.server.SSH_PORT;
sourcePort = nodes.sin.config.services.gitea.settings.server.SSH_PORT;
proto = "tcp";
destination = "10.0.0.4:22";
} ];

View File

@ -1,7 +0,0 @@
{nodes, ...}:{
networking.nat.forwardPorts = [{
sourcePort = nodes.zimablade.config.services.gitea.settings.server.SSH_PORT;
proto = "tcp";
destination = "10.0.0.4:22";
}];
}

View File

@ -8,7 +8,15 @@ in {
server = {
DOMAIN = "git.shobu.fr";
SSH_PORT = ssh_port;
ROOT_URL = "https://git.shobu.fr";
};
service = {
REGISTER_EMAIL_CONFIRM = false;
REGISTER_MANUAL_CONFIRM = true;
};
actions = {
ENABLED = true;
};
};
};
};

View File

@ -0,0 +1,10 @@
{nodes, ...}:{
imports = [
./virtualisation.nix
];
networking.nat.forwardPorts = [{
sourcePort = nodes.sin.config.services.gitea.settings.server.SSH_PORT;
proto = "tcp";
destination = "10.0.0.4:22";
}];
}

View File

@ -0,0 +1,36 @@
{nodes, ...}: {
systemd.sockets.podman.socketConfig.Symlinks = [
"/run/docker.sock"
];
virtualisation = {
containers = {
enable = true;
# storage.settings = {
# storage = {
# driver = "btrfs";
# };
# };
};
podman = {
enable = true;
dockerCompat = true;
dockerSocket.enable = true;
defaultNetwork.settings.dns_enabled = true;
autoPrune.enable = true;
};
};
virtualisation.oci-containers.containers = {
gitea-runner = {
image = "gitea/act_runner@sha256:8477d5b61b655caad4449888bae39f1f34bebd27db56cb15a62dccb3dcf3a944";
autoStart = true;
environment = {
GITEA_INSTANCE_URL = nodes.sin.config.services.gitea.settings.server.ROOT_URL;
GITEA_RUNNER_REGISTRATION_TOKEN = "uEDPBW6Z9oItAKRtloVwis0LkPbD4OmV2w5esOhW";
};
volumes = [
"/var/run/docker.sock:/var/run/docker.sock"
];
};
};
}