manatee: Add schema
The household weekly plan at schema.ppp.pm: its module, certificate, DNS record, backup and secrets. The link to puppy-tracker is prepared but commented out until puppy-tracker with the integration feed is deployed.
This commit is contained in:
1 parent
eb6477d34a
commit
3a115df8a7
10 files changed
+114
-1
No files matched your search
@@ -30,6 +30,7 @@ in
|
||||
"romm.ppp.pm"
|
||||
"puppy.ppp.pm"
|
||||
"todo.ppp.pm"
|
||||
"schema.ppp.pm"
|
||||
] (_: hetznerCert);
|
||||
};
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ in
|
||||
puppy-tracker.enable = true;
|
||||
solo-referee.enable = true;
|
||||
todo.enable = true;
|
||||
schema.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -251,7 +251,7 @@ in
|
||||
];
|
||||
|
||||
script = ''
|
||||
SUBDOMAINS="ha komga romm puppy todo"
|
||||
SUBDOMAINS="ha komga romm puppy todo schema"
|
||||
INTERFACE="enp3s0"
|
||||
|
||||
CURRENT_IP=$(curl -s --fail --interface "$INTERFACE" ifconfig.me)
|
||||
|
||||
@@ -104,6 +104,7 @@ let
|
||||
snapshot /var/lib/puppy-tracker "$STATE/puppy-tracker"
|
||||
snapshot /var/lib/solo-referee "$STATE/solo-referee"
|
||||
snapshot /var/lib/todo "$STATE/todo"
|
||||
snapshot /var/lib/schema "$STATE/schema"
|
||||
snapshot /var/lib/komga-book-manager "$STATE/komga-book-manager"
|
||||
snapshot /var/lib/komga-reading-stats "$STATE/komga-reading-stats"
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
enabled = config.mod.schema.enable;
|
||||
nginxEnabled = config.mod.nginx.enable;
|
||||
port = 8092;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
mod.schema = {
|
||||
enable = lib.mkEnableOption "Enable schema module";
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
inputs.schema.nixosModules.default
|
||||
];
|
||||
|
||||
config = lib.mkIf enabled {
|
||||
mod.homepage.services = [
|
||||
{
|
||||
name = "Schema";
|
||||
port = port;
|
||||
description = "Our week: chores, meals, dog";
|
||||
# Login needs HTTPS (Secure cookies), so link to the public vhost.
|
||||
url = "https://schema.ppp.pm";
|
||||
}
|
||||
];
|
||||
|
||||
services.schema = {
|
||||
enable = true;
|
||||
address = "127.0.0.1";
|
||||
inherit port;
|
||||
# Served publicly over HTTPS via the nginx vhost below.
|
||||
secureCookies = true;
|
||||
inviteCodeFile = config.age.secrets."schema-invite-code".path;
|
||||
timeZone = "Europe/Stockholm";
|
||||
|
||||
# Walks and meals logged in puppy-tracker tick off dog duties here. Needs
|
||||
# the integration endpoint from puppy-tracker (see below) to be deployed.
|
||||
# puppyTracker = {
|
||||
# url = "http://127.0.0.1:8089";
|
||||
# tokenFile = config.age.secrets."schema-puppy-token".path;
|
||||
# };
|
||||
};
|
||||
|
||||
# The other half of the puppy-tracker link, enabled together with the
|
||||
# block above once puppy-tracker with integration.tokenFile is pushed.
|
||||
# services.puppy-tracker.integration.tokenFile = config.age.secrets."schema-puppy-token".path;
|
||||
# age.secrets."schema-puppy-token".file = ../../../../secrets/manatee/schema-puppy-token.age;
|
||||
|
||||
services.nginx = lib.mkIf nginxEnabled {
|
||||
virtualHosts."schema.ppp.pm" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "schema.ppp.pm";
|
||||
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString port}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
age.secrets."schema-invite-code".file = ../../../../secrets/manatee/schema-invite-code.age;
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user