From b634e50cb0d191eaea00931e1aa86c9feaf7662c Mon Sep 17 00:00:00 2001 From: Sergei Poljanski Date: Tue, 17 Nov 2026 05:54:34 +0400 Subject: [PATCH] nixos: accept Debian ops's certificate push until ops converts Between the two conversions, services runs NixOS while ops still pushes the XMPP certificates with the key Ansible generated there. Authorize that key too, with the same forced command and source restriction, so renewals keep reaching ejabberd. Remove it after the ops conversion. Assisted-by: Claude:opus-5-5 --- nixos/hosts/asxpio-services/xmpp-cert-install.nix | 15 ++++++++++++--- nixos/hosts/rehearsal/services.nix | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/nixos/hosts/asxpio-services/xmpp-cert-install.nix b/nixos/hosts/asxpio-services/xmpp-cert-install.nix index 346aea0..908b45b 100644 --- a/nixos/hosts/asxpio-services/xmpp-cert-install.nix +++ b/nixos/hosts/asxpio-services/xmpp-cert-install.nix @@ -26,7 +26,16 @@ in description = "Public half of xmpp_cert_sync/ssh_key in the ops secrets."; }; - config.users.users.root.openssh.authorizedKeys.keys = [ - ''restrict,from="10.10.0.10",command="${lib.getExe install}" ${config.asxpio.xmppCertSyncKey} xmpp-cert-sync'' - ]; + options.asxpio.xmppCertSyncKeysExtra = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ + # Debian asxpio-ops's key (Ansible role xmpp_cert_sync), until ops + # runs NixOS too. Remove after the ops conversion. + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGLSz8AvKF/cHmMBGxn7+BqNHa/g79xmRrnb7779lXLo" + ]; + }; + + config.users.users.root.openssh.authorizedKeys.keys = map ( + key: ''restrict,from="10.10.0.10",command="${lib.getExe install}" ${key} xmpp-cert-sync'' + ) ([ config.asxpio.xmppCertSyncKey ] ++ config.asxpio.xmppCertSyncKeysExtra); } diff --git a/nixos/hosts/rehearsal/services.nix b/nixos/hosts/rehearsal/services.nix index 2ea3bdc..cd1617f 100644 --- a/nixos/hosts/rehearsal/services.nix +++ b/nixos/hosts/rehearsal/services.nix @@ -13,6 +13,7 @@ systemd.network.networks."10-public".address = lib.mkForce [ "2a01:4f9:c01d:6f9::1/64" ]; asxpio.publicIPv4 = "2.29.197.9"; + asxpio.xmppCertSyncKeysExtra = [ ]; asxpio.xmppCertSyncKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHXhvaO3Dhkw3QuMUHycoPU12Vx8bKWk2PCFoULvnTAf"; # A 4 GB server