From ab9caaf520688f2c50733e8a34ea5d4cb0a28a51 Mon Sep 17 00:00:00 2001 From: emilylange Date: Tue, 16 Jul 2024 15:42:10 +0200 Subject: [PATCH] systems: add git.forkos.org --- common/ssh-keys.nix | 1 + flake.nix | 1 + hosts/git/default.nix | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 hosts/git/default.nix diff --git a/common/ssh-keys.nix b/common/ssh-keys.nix index 6133090..eb1afb8 100644 --- a/common/ssh-keys.nix +++ b/common/ssh-keys.nix @@ -4,6 +4,7 @@ meta01 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM5t9gYorOWgpCFDJgb24pyCKIabGpeI2H/UfdvXODcT"; gerrit01 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA+eSZu+u9sCynrMlsmFzQHLIELQAuVg0Cs1pBvwb4+A"; fodwatch = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFRyTNfvKl5FcSyzGzw+h+bNFNOxdhvI67WdUZ2iIJ1L"; + git = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEQJcpkCUOx8+5oukMX6lxrYcIX8FyHu8Mc/3+ieKMUn"; builder-0 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBHSNcDGctvlG6BHcJuYIzW9WsBJsts2vpwSketsbXoL"; builder-1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIQOGUjERK7Mx8UPM/rbOdMqVyn1sbWqYOG6CbOzH2wm"; builder-2 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMKzXIqCoYElEKIYgjbSpqEcDeOvV+Wo3Agq3jba83cB"; diff --git a/flake.nix b/flake.nix index 5d7281e..84f7cff 100644 --- a/flake.nix +++ b/flake.nix @@ -99,6 +99,7 @@ meta01.imports = commonModules ++ [ ./hosts/meta01 ]; gerrit01.imports = commonModules ++ [ ./hosts/gerrit01 ]; fodwatch.imports = commonModules ++ [ ./hosts/fodwatch ]; + git.imports = commonModules ++ [ ./hosts/git ]; wob-vpn-gw.imports = commonModules ++ [ ./hosts/wob-vpn-gw ]; } // builders; diff --git a/hosts/git/default.nix b/hosts/git/default.nix new file mode 100644 index 0000000..7d3383c --- /dev/null +++ b/hosts/git/default.nix @@ -0,0 +1,43 @@ +let + ipv6 = { + openssh ="2001:bc8:38ee:100:1000::41"; + forgejo = "2001:bc8:38ee:100:1000::40"; + }; +in +{ + networking.hostName = "git"; + networking.domain = "infra.forkos.org"; + + time.timeZone = "Europe/Paris"; + + bagel.sysadmin.enable = true; + # Forgejo will be proxied. + bagel.raito.v6-proxy-awareness.enable = true; + bagel.hardware.raito-vm = { + enable = true; + networking = { + nat-lan-mac = "BC:24:11:83:71:56"; + wan = { + address = "${ipv6.forgejo}/64"; + mac = "BC:24:11:0B:8A:81"; + }; + }; + }; + + # Add one additional IPv6, so we can have both OpenSSH and + # Forgejo's built-in server bind on port :22. + systemd.network.networks."10-wan".networkConfig.Address = [ "${ipv6.openssh}/64" ]; + services.openssh.listenAddresses = [{ + addr = "[${ipv6.openssh}]"; + }]; + + bagel.services.forgejo = { + enable = true; + sshBindAddr = ipv6.forgejo; + }; + + i18n.defaultLocale = "en_US.UTF-8"; + + system.stateVersion = "24.05"; + deployment.targetHost = "git.infra.forkos.org"; +}