Migrate from gitea to forgejo.
This commit is contained in:
parent
3de8ff246f
commit
4c29603f14
5 changed files with 23 additions and 23 deletions
59
services/forgejo.nix
Normal file
59
services/forgejo.nix
Normal file
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
mkIf (elem "forgejo" config.machine.services) {
|
||||
services = {
|
||||
forgejo = let
|
||||
cfg = config.machine;
|
||||
inherit ((findFirst (s: s.service == "forgejo") cfg cfg.vHosts)) domain;
|
||||
in {
|
||||
enable = true;
|
||||
user = "git";
|
||||
database = {
|
||||
type = "mysql";
|
||||
user = "git";
|
||||
name = "forgejo";
|
||||
passwordFile = config.sops.secrets."services/forgejo/dbPass".path;
|
||||
};
|
||||
settings = {
|
||||
repository = {
|
||||
DISABLE_HTTP_GIT = false;
|
||||
USE_COMPAT_SSH_URI = true;
|
||||
};
|
||||
|
||||
security = {
|
||||
INSTALL_LOCK = true;
|
||||
COOKIE_USERNAME = "forgejo_username";
|
||||
COOKIE_REMEMBER_NAME = "forgejo_userauth";
|
||||
};
|
||||
|
||||
server = {
|
||||
DOMAIN = domain;
|
||||
ROOT_URL = "https://${domain}/";
|
||||
};
|
||||
|
||||
service = {
|
||||
DISABLE_REGISTRATION = lib.mkForce true;
|
||||
};
|
||||
|
||||
session = {
|
||||
cookieSecure = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
sops.secrets."services/forgejo/dbPass" = {
|
||||
owner = "git";
|
||||
group = "forgejo";
|
||||
};
|
||||
users.users.git = {
|
||||
description = "Forgejo Service";
|
||||
isNormalUser = true;
|
||||
home = config.services.forgejo.stateDir;
|
||||
createHome = false;
|
||||
useDefaultShell = true;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue