services: gitea: factorize gitea user
This commit is contained in:
parent
3dc21e88a8
commit
42e681bb81
|
@ -17,6 +17,8 @@
|
||||||
domain = config.networking.domain;
|
domain = config.networking.domain;
|
||||||
hostname = config.networking.hostName;
|
hostname = config.networking.hostName;
|
||||||
fqdn = "${hostname}.${domain}";
|
fqdn = "${hostname}.${domain}";
|
||||||
|
|
||||||
|
giteaUser = "git";
|
||||||
in {
|
in {
|
||||||
options.my.services.gitea = let
|
options.my.services.gitea = let
|
||||||
inherit (lib) types;
|
inherit (lib) types;
|
||||||
|
@ -33,11 +35,11 @@ in {
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
# use git as user to have `git clone git@git.domain`
|
# use git as user to have `git clone git@git.domain`
|
||||||
users.users.git = {
|
users.users.${giteaUser} = {
|
||||||
description = "Gitea Service";
|
description = "Gitea Service";
|
||||||
home = config.services.gitea.stateDir;
|
home = config.services.gitea.stateDir;
|
||||||
useDefaultShell = true;
|
useDefaultShell = true;
|
||||||
group = "git";
|
group = giteaUser;
|
||||||
|
|
||||||
# the systemd service for the gitea module seems to hardcode the group as
|
# the systemd service for the gitea module seems to hardcode the group as
|
||||||
# gitea, so, uh, just in case?
|
# gitea, so, uh, just in case?
|
||||||
|
@ -45,11 +47,11 @@ in {
|
||||||
|
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
};
|
};
|
||||||
users.groups.git = {};
|
users.groups.${giteaUser} = {};
|
||||||
|
|
||||||
services.gitea = {
|
services.gitea = {
|
||||||
enable = true;
|
enable = true;
|
||||||
user = "git";
|
user = giteaUser;
|
||||||
domain = "git.${domain}";
|
domain = "git.${domain}";
|
||||||
appName = "Personal Forge";
|
appName = "Personal Forge";
|
||||||
rootUrl = "https://git.${domain}/";
|
rootUrl = "https://git.${domain}/";
|
||||||
|
@ -80,7 +82,7 @@ in {
|
||||||
database = {
|
database = {
|
||||||
type = "postgres";
|
type = "postgres";
|
||||||
# user needs to be the same as gitea user
|
# user needs to be the same as gitea user
|
||||||
user = "git";
|
user = giteaUser;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue