mirror of
https://github.com/callumio/nixfiles.git
synced 2025-12-17 03:29:20 +00:00
forgejo
This commit is contained in:
parent
06c972ef26
commit
bf7d690ff5
4 changed files with 48 additions and 0 deletions
|
|
@ -8,5 +8,6 @@
|
||||||
./ssh.nix
|
./ssh.nix
|
||||||
./media.nix
|
./media.nix
|
||||||
./headscale.nix
|
./headscale.nix
|
||||||
|
./forgejo.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
39
hosts/hermes/forgejo.nix
Normal file
39
hosts/hermes/forgejo.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
domain = "git.cleslie.uk";
|
||||||
|
in {
|
||||||
|
services = {
|
||||||
|
forgejo = {
|
||||||
|
enable = true;
|
||||||
|
database.type = "postgres";
|
||||||
|
settings = {
|
||||||
|
server = {
|
||||||
|
#DOMAIN = domain;
|
||||||
|
ROOT_URL = "https://${domain}";
|
||||||
|
HTTP_PORT = 3000;
|
||||||
|
SSH_PORT = builtins.head config.services.openssh.ports;
|
||||||
|
};
|
||||||
|
service.DISABLE_REGISTRATION = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
caddy.virtualHosts.${domain}.extraConfig = ''
|
||||||
|
reverse_proxy localhost:${toString config.services.forgejo.settings.server.HTTP_PORT}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.forgejo.preStart = ''
|
||||||
|
admin="${lib.getExe config.services.forgejo.package} admin user"
|
||||||
|
$admin create --admin --email "git@cleslie.uk" --username cleslie --password "$(tr -d '\n' < ${config.age.secrets.forgejo-password.path})" || true
|
||||||
|
# $admin change-password --username cleslie --password "$(tr -d '\n' < ${config.age.secrets.forgejo-password.path})" || true
|
||||||
|
'';
|
||||||
|
|
||||||
|
age.secrets."forgejo-password" = {
|
||||||
|
file = ../../secrets/forgejo-password.age;
|
||||||
|
mode = "400";
|
||||||
|
owner = "forgejo";
|
||||||
|
};
|
||||||
|
}
|
||||||
7
secrets/forgejo-password.age
Normal file
7
secrets/forgejo-password.age
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 /RyXeg IjBz5+4Rk9Rg+jBgKWo/B5IoZmq/wTCWcqZRB/5lhAU
|
||||||
|
E2bov9sYropmovrjqTItnLLzgEECt6+9iD2zjHLvXbU
|
||||||
|
-> ssh-ed25519 aSaoJQ Rjq+7b3BFCrUFuVQhvrpxm8i4D7jpkkLleu36r4cinM
|
||||||
|
HpdvPeOUqUOxdcsnBd5QWiU00Di7xcKHLstI8Z9p6EM
|
||||||
|
--- 3Ku+G1FBZdVdS31q7fKd68Ai+FkD1rJg0eSKpYLd+2c
|
||||||
|
_ÎPEÚ ú#]¬È¼<17>ìlX‚“"ý¬ba·4¢Õ–•AƒlG8Œsot ~ióþé#/ib¡Î1eôµ7Þ›³ÿù
|
||||||
|
|
@ -9,4 +9,5 @@ in {
|
||||||
"wg-conf.age".publicKeys = keys.c ++ allSystems;
|
"wg-conf.age".publicKeys = keys.c ++ allSystems;
|
||||||
"mesh-conf-infra.age".publicKeys = keys.c ++ allSystems;
|
"mesh-conf-infra.age".publicKeys = keys.c ++ allSystems;
|
||||||
"mesh-conf-cleslie.age".publicKeys = keys.c ++ allSystems;
|
"mesh-conf-cleslie.age".publicKeys = keys.c ++ allSystems;
|
||||||
|
"forgejo-password.age".publicKeys = keys.c ++ [systems.hermes];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue