mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2025-01-18 16:56:46 +01:00
WIP: gitea: init gpg signing key
This commit is contained in:
parent
07777edafb
commit
78028846a9
@ -6,6 +6,7 @@ let
|
|||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./ci.nix
|
./ci.nix
|
||||||
|
./gpg.nix
|
||||||
./import-users
|
./import-users
|
||||||
./web-secret-provider
|
./web-secret-provider
|
||||||
];
|
];
|
||||||
|
26
hosts/bekkalokk/services/gitea/gpg.nix
Normal file
26
hosts/bekkalokk/services/gitea/gpg.nix
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.services.gitea;
|
||||||
|
GNUPGHOME = "${config.users.users.gitea.home}/gnupg";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
sops.secrets."gitea/gpg-signing-key" = {
|
||||||
|
owner = cfg.user;
|
||||||
|
inherit (cfg) group;
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.gitea.environment = { inherit GNUPGHOME; };
|
||||||
|
|
||||||
|
systemd.services.gitea-ensure-gnupg-homedir = {
|
||||||
|
description = "Import gpg key for gitea";
|
||||||
|
environment = { inherit GNUPGHOME; };
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = cfg.user;
|
||||||
|
PrivateNetwork = true;
|
||||||
|
};
|
||||||
|
script = ''
|
||||||
|
${lib.getExe pkgs.gnupg} --import ${config.sops.secrets."gitea/gpg-signing-key".path}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user