From 9d5119143430d4e3b6de71cc803cfd1860706b63 Mon Sep 17 00:00:00 2001 From: janabhumi Date: Tue, 18 Oct 2022 00:42:23 +0300 Subject: [PATCH] machines/magenta: restructure services --- machines/magenta/services/gitea.nix | 36 ++++++++++++++++------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/machines/magenta/services/gitea.nix b/machines/magenta/services/gitea.nix index 27deb90..77353b2 100644 --- a/machines/magenta/services/gitea.nix +++ b/machines/magenta/services/gitea.nix @@ -1,6 +1,19 @@ { config, pkgs, lib, ... }: -let hostname = "nix-git.pleshevski.ru"; in +let + hostname = "nix-git.pleshevski.ru"; + + gitea = pkgs.gitea.overrideAttrs (oldAttrs: { + postInstall = with pkgs; '' + mkdir $data + cp -R ./go/src/${oldAttrs.goPackagePath}/{public,templates,options} $data + mkdir -p $out + cp -R ./go/src/${oldAttrs.goPackagePath}/options/locale $out/locale + wrapProgram $out/bin/gitea \ + --prefix PATH : ${lib.makeBinPath [ bash git gzip openssh gnupg ]} + ''; + }); +in { services.postgresql.package = pkgs.postgresql_14; @@ -10,20 +23,11 @@ let hostname = "nix-git.pleshevski.ru"; in user = { email = "gitea@noreply.pleshevski.ru"; name = "Gitea"; - signingKey = "7B1C00B534537C0E"; + signingKey = "745324BD4A15B11F5725B8E6A29AAC22198EF078"; }; - gpg.program = "/run/current-system/sw/bin/gpg"; + gpg.program = "${pkgs.gnupg}/bin/gpg"; commit.gpgSign = true; tag.gpgSign = true; - core = { - quotePath = false; - commitGraph = true; - }; - receive = { - advertisePushOptions = true; - procReceiveRefs = "refs/for"; - }; - gc.writeCommitGraph = true; }; }; @@ -31,6 +35,7 @@ let hostname = "nix-git.pleshevski.ru"; in services.gitea = { enable = true; + package = gitea; httpPort = 9901; domain = hostname; rootUrl = "https://${hostname}"; @@ -74,10 +79,9 @@ let hostname = "nix-git.pleshevski.ru"; in DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH = true; }; "repository.signing" = { - #SIGNING_EMAIL = "gitea@noreply.pleshevski.ru"; - #SIGNING_NAME = "Gitea"; - #SIGNING_KEY = "E1DDBF5A1406BB987779A85F55B75599806CD426"; - SIGNING_KEY = "default"; + SIGNING_EMAIL = "gitea@noreply.pleshevski.ru"; + SIGNING_NAME = "Gitea"; + SIGNING_KEY = "745324BD4A15B11F5725B8E6A29AAC22198EF078"; DEFAULT_TRUST_MODEL = "collaboratorcommiter"; MERGES = "pubkey,basesigned,commitssigned"; };