From 46491fafde7a41402980748981d00982a95a0826 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Wed, 7 Feb 2024 10:16:15 +0300 Subject: [PATCH] Make Forgejo use git@ --- hosts/cube/forgejo.nix | 10 ++++++++-- modules/git.nix | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hosts/cube/forgejo.nix b/hosts/cube/forgejo.nix index 4c8ff09..9b7b56e 100644 --- a/hosts/cube/forgejo.nix +++ b/hosts/cube/forgejo.nix @@ -15,6 +15,12 @@ in serverSystemConfiguration { }]; }; + users.users.git = { + createHome = false; + group = "forgejo"; + isSystemUser = true; + }; + services.forgejo = enabled { lfs = enabled {}; @@ -79,8 +85,8 @@ in serverSystemConfiguration { HTTP_ADDR = "::"; HTTP_PORT = 8004; - SSH_CREATE_AUTHORIZED_KEYS_FILE = true; - SSH_PORT = builtins.elemAt config.services.openssh.ports 0; + SSH_PORT = builtins.elemAt config.services.openssh.ports 0; + SSH_USER = "git"; DISABLE_ROUTER_LOG = true; }; diff --git a/modules/git.nix b/modules/git.nix index f57cdb4..cd1275a 100644 --- a/modules/git.nix +++ b/modules/git.nix @@ -81,7 +81,7 @@ homeConfiguration { core.sshCommand = "ssh -i ~/.ssh/id"; url."ssh://git@github.com/".insteadOf = "https://github.com/"; - url."ssh://forgejo@rgbcu.be:2222/".insteadOf = "https://git.rgbcu.be/"; + url."ssh://git@rgbcu.be:2222/".insteadOf = "https://git.rgbcu.be/"; } // lib.optionalAttrs ulib.isDesktop { commit.gpgSign = true; gpg.format = "ssh";