feat: forgejo test

This commit is contained in:
Nick 2025-01-19 00:32:58 -06:00
parent 95ca704508
commit 715a0271eb
2 changed files with 37 additions and 34 deletions

View file

@ -1,7 +1,7 @@
{instancesFunctions}: let { instancesFunctions }:
inherit let
(instancesFunctions) inherit (instancesFunctions)
domain1 domain3
servicePath servicePath
sslPath sslPath
sopsPath sopsPath
@ -9,11 +9,12 @@
mastodonLabel = "Mastodon"; mastodonLabel = "Mastodon";
mastodonName = "mastodon"; mastodonName = "mastodon";
in { in
{
label = mastodonLabel; label = mastodonLabel;
name = mastodonName; name = mastodonName;
email = { email = {
address0 = "thenutrivore@${domain1}"; address0 = "noreply@${domain3}";
}; };
sops = { sops = {
path0 = "${sopsPath}/${mastodonName}"; path0 = "${sopsPath}/${mastodonName}";
@ -24,7 +25,7 @@ in {
path2 = ""; path2 = "";
}; };
ssl = { ssl = {
cert = "${sslPath}/${domain1}/fullchain.pem"; cert = "${sslPath}/${domain3}/fullchain.pem";
key = "${sslPath}/${domain1}/key.pem"; key = "${sslPath}/${domain3}/key.pem";
}; };
} }

View file

@ -4,20 +4,20 @@
pkgs, pkgs,
lib, lib,
... ...
}: let }:
inherit let
(flake.config.machines.devices) inherit (flake.config.machines.devices)
server server
; ;
inherit inherit (flake.config.services.instances)
(flake.config.services.instances)
mastodon mastodon
web web
; ;
service = mastodon; service = mastodon;
host = web.domains.url1; host = web.domains.url3;
localhost = web.localhost.address0; localhost = web.localhost.address0;
in { in
{
# If you need to start fresh for some reason, run these to create the new Admin account: # If you need to start fresh for some reason, run these to create the new Admin account:
# sudo -u mastodon mastodon-tootctl accounts create nick --email=nick@localhost --confirmed --role=Owner # sudo -u mastodon mastodon-tootctl accounts create nick --email=nick@localhost --confirmed --role=Owner
# sudo -u mastodon mastodon-tootctl accounts approve nick # sudo -u mastodon mastodon-tootctl accounts approve nick
@ -165,26 +165,28 @@ in {
"/run/mastodon-web" "/run/mastodon-web"
]; ];
sops = let sops =
sopsPath = secret: { let
path = "${service.sops.path0}/${service.name}-${secret}"; sopsPath = secret: {
owner = service.name; path = "${service.sops.path0}/${service.name}-${secret}";
mode = "600"; owner = service.name;
mode = "600";
};
in
{
secrets = builtins.listToAttrs (
map
(secret: {
name = "${service.name}-${secret}";
value = sopsPath secret;
})
[
"smtp"
"database"
"redis"
]
);
}; };
in {
secrets = builtins.listToAttrs (
map
(secret: {
name = "${service.name}-${secret}";
value = sopsPath secret;
})
[
"smtp"
"database"
"redis"
]
);
};
fileSystems."/var/lib/${service.name}" = { fileSystems."/var/lib/${service.name}" = {
device = service.paths.path0; device = service.paths.path0;