From 715a0271eb99454594bd32d4e6274f421c620248 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 19 Jan 2025 00:32:58 -0600 Subject: [PATCH] feat: forgejo test --- config/instances/config/mastodon.nix | 17 ++++--- nixos/modules/services/mastodon/default.nix | 54 +++++++++++---------- 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/config/instances/config/mastodon.nix b/config/instances/config/mastodon.nix index 4d26b35..415d839 100755 --- a/config/instances/config/mastodon.nix +++ b/config/instances/config/mastodon.nix @@ -1,7 +1,7 @@ -{instancesFunctions}: let - inherit - (instancesFunctions) - domain1 +{ instancesFunctions }: +let + inherit (instancesFunctions) + domain3 servicePath sslPath sopsPath @@ -9,11 +9,12 @@ mastodonLabel = "Mastodon"; mastodonName = "mastodon"; -in { +in +{ label = mastodonLabel; name = mastodonName; email = { - address0 = "thenutrivore@${domain1}"; + address0 = "noreply@${domain3}"; }; sops = { path0 = "${sopsPath}/${mastodonName}"; @@ -24,7 +25,7 @@ in { path2 = ""; }; ssl = { - cert = "${sslPath}/${domain1}/fullchain.pem"; - key = "${sslPath}/${domain1}/key.pem"; + cert = "${sslPath}/${domain3}/fullchain.pem"; + key = "${sslPath}/${domain3}/key.pem"; }; } diff --git a/nixos/modules/services/mastodon/default.nix b/nixos/modules/services/mastodon/default.nix index 2e92af7..18e7319 100755 --- a/nixos/modules/services/mastodon/default.nix +++ b/nixos/modules/services/mastodon/default.nix @@ -4,20 +4,20 @@ pkgs, lib, ... -}: let - inherit - (flake.config.machines.devices) +}: +let + inherit (flake.config.machines.devices) server ; - inherit - (flake.config.services.instances) + inherit (flake.config.services.instances) mastodon web ; service = mastodon; - host = web.domains.url1; + host = web.domains.url3; localhost = web.localhost.address0; -in { +in +{ # 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 approve nick @@ -165,26 +165,28 @@ in { "/run/mastodon-web" ]; - sops = let - sopsPath = secret: { - path = "${service.sops.path0}/${service.name}-${secret}"; - owner = service.name; - mode = "600"; + sops = + let + sopsPath = secret: { + path = "${service.sops.path0}/${service.name}-${secret}"; + 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}" = { device = service.paths.path0;