diff --git a/hosts/cube/forgejo/default.nix b/hosts/cube/forgejo/default.nix index 0c2e99d..aad9cb0 100644 --- a/hosts/cube/forgejo/default.nix +++ b/hosts/cube/forgejo/default.nix @@ -66,6 +66,8 @@ in systemConfiguration { services.openssh.settings.AcceptEnv = mkForce "COLORTERM GIT_PROTOCOL"; services.forgejo = enabled { + inherit fqdn; + lfs = enabled; mailerPasswordFile = config.secrets.forgejoMailPassword.path; diff --git a/hosts/disk/mail/default.nix b/hosts/disk/mail/default.nix index 6c0151c..1f0d5c2 100644 --- a/hosts/disk/mail/default.nix +++ b/hosts/disk/mail/default.nix @@ -28,7 +28,7 @@ in systemConfiguration { }; mailserver = enabled { - inherit fqdn; + inherit domain fqdn; domains = [ domain ]; certificateScheme = "acme"; diff --git a/modules/git.nix b/modules/git.nix index eaa1fa7..c534dde 100644 --- a/modules/git.nix +++ b/modules/git.nix @@ -65,9 +65,8 @@ }) (let - inherit (self.disk.networking) domain; - - gitHost = self.cube.networking.hostName; + gitDomain = self.cube.services.forgejo.fqdn; + mailDomain = self.disk.mailserver.domain; in homeConfiguration { programs.nushell.configFile.text = mkAfter '' # Sets the remote origin to the specified user and repository on my git instance @@ -78,7 +77,7 @@ in homeConfiguration { "RGBCube/" + $user_and_repo } - git remote add origin ("https://${gitHost}/" + $user_and_repo) + git remote add origin ("https://${gitDomain}/" + $user_and_repo) } ''; @@ -86,7 +85,7 @@ in homeConfiguration { package = pkgs.gitFull; userName = "RGBCube"; - userEmail = "git@${domain}"; + userEmail = "git@${mailDomain}"; lfs = enabled; @@ -125,9 +124,9 @@ in homeConfiguration { # https://bernsteinbear.com/git alias.recent = "! git branch --sort=-committerdate --format=\"%(committerdate:relative)%09%(refname:short)\" | head -10"; - core.sshCommand = "ssh -i ~/.ssh/id"; - url."ssh://git@github.com/".insteadOf = "https://github.com/"; - url."ssh://forgejo@${domain}:2222/".insteadOf = "https://git.${gitHost}/"; + core.sshCommand = "ssh -i ~/.ssh/id"; + url."ssh://git@github.com/".insteadOf = "https://github.com/"; + url."ssh://forgejo@${gitDomain}:2222/".insteadOf = "https://${gitDomain}/"; } (mkIf isDesktop { commit.gpgSign = true; tag.gpgSign = true; diff --git a/options/domains.nix b/options/domains.nix new file mode 100644 index 0000000..ebd571d --- /dev/null +++ b/options/domains.nix @@ -0,0 +1,7 @@ +{ lib, ... }: { + options = { + mailserver.domain = lib.mkValue null; + + services.forgejo.fqdn = lib.mkValue null; + }; +}