Compare commits

...

2 commits

22 changed files with 103 additions and 108 deletions

View file

@ -20,16 +20,16 @@
boot.loader.grub.enable = true; boot.loader.grub.enable = true;
services = services.tailscale = {
let
tailscaleDomain = config.custom.services.tailscale.domain;
in
{
tailscale = {
enable = true; enable = true;
ssh.enable = true; ssh.enable = true;
}; };
web-services =
let
tailscaleDomain = config.custom.services.tailscale.domain;
in
{
gatus = { gatus = {
enable = true; enable = true;
domain = "status.${tailscaleDomain}"; domain = "status.${tailscaleDomain}";

View file

@ -13,23 +13,24 @@
ports.validate = true; ports.validate = true;
}; };
custom = { custom =
let
tailscaleDomain = config.custom.services.tailscale.domain;
in
{
persistence.enable = true; persistence.enable = true;
sops.enable = true; sops.enable = true;
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
services = services = {
let
tailscaleDomain = config.custom.services.tailscale.domain;
in
{
tailscale = { tailscale = {
enable = true; enable = true;
ssh.enable = true; ssh.enable = true;
exitNode.enable = true; exitNode.enable = true;
}; };
nebula.node = { nebula.node = {
enable = true; enable = true;
address = "10.254.250.2"; address = "10.254.250.2";
@ -44,7 +45,9 @@
deviceId = "5R2MH7T-Q2ZZS2P-ZMSQ2UJ-B6VBHES-XYLNMZ6-7FYC27L-4P7MGJ2-FY4ITQD"; deviceId = "5R2MH7T-Q2ZZS2P-ZMSQ2UJ-B6VBHES-XYLNMZ6-7FYC27L-4P7MGJ2-FY4ITQD";
gui.domain = "syncthing.${tailscaleDomain}"; gui.domain = "syncthing.${tailscaleDomain}";
}; };
};
web-services = {
filebrowser = { filebrowser = {
enable = true; enable = true;
domain = "files.${tailscaleDomain}"; domain = "files.${tailscaleDomain}";

View file

@ -20,12 +20,7 @@
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
services = services = {
let
sstorkDomain = "sstork.dev";
sproutedDomain = "sprouted.cloud";
in
{
tailscale = { tailscale = {
enable = true; enable = true;
ssh.enable = true; ssh.enable = true;
@ -36,6 +31,14 @@
bouncers.firewall = true; bouncers.firewall = true;
}; };
};
web-services =
let
sstorkDomain = "sstork.dev";
sproutedDomain = "sprouted.cloud";
in
{
personal-blog = { personal-blog = {
enable = true; enable = true;
domain = sstorkDomain; domain = sstorkDomain;
@ -59,15 +62,6 @@
domain = "tools.${sproutedDomain}"; domain = "tools.${sproutedDomain}";
}; };
stirling-pdf = {
enable = true;
domain = "pdf.${sproutedDomain}";
branding = {
name = "Sprouted PDF";
description = "Sprouted's one-stop-shop for all your PDF needs.";
};
};
privatebin = { privatebin = {
enable = true; enable = true;
domain = "pastebin.${sproutedDomain}"; domain = "pastebin.${sproutedDomain}";

View file

@ -1,11 +1,11 @@
{ config, lib, ... }: { config, lib, ... }:
let let
cfg = config.custom.services.actualbudget; cfg = config.custom.web-services.actualbudget;
inherit (config.services.actual.settings) dataDir; inherit (config.services.actual.settings) dataDir;
in in
{ {
options.custom.services.actualbudget = { options.custom.web-services.actualbudget = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;

View file

@ -1,9 +1,9 @@
{ config, lib, ... }: { config, lib, ... }:
let let
cfg = config.custom.services.alloy; cfg = config.custom.web-services.alloy;
in in
{ {
options.custom.services.alloy = { options.custom.web-services.alloy = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;
@ -121,7 +121,7 @@ in
text = '' text = ''
prometheus.scrape "victorialogs" { prometheus.scrape "victorialogs" {
targets = [{ targets = [{
__address__ = "localhost:${toString config.custom.services.victorialogs.port}", __address__ = "localhost:${toString config.custom.web-services.victorialogs.port}",
job = "victorialogs", job = "victorialogs",
instance = constants.hostname, instance = constants.hostname,
}] }]

View file

@ -7,12 +7,12 @@
... ...
}: }:
let let
cfg = config.custom.services.filebrowser; cfg = config.custom.web-services.filebrowser;
dataDir = "/var/lib/filebrowser"; dataDir = "/var/lib/filebrowser";
in in
{ {
options.custom.services.filebrowser = { options.custom.web-services.filebrowser = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;

View file

@ -1,9 +1,9 @@
{ config, lib, ... }: { config, lib, ... }:
let let
cfg = config.custom.services.forgejo; cfg = config.custom.web-services.forgejo;
in in
{ {
options.custom.services.forgejo = { options.custom.web-services.forgejo = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;

View file

@ -1,9 +1,9 @@
{ config, lib, ... }: { config, lib, ... }:
let let
cfg = config.custom.services.forgejo.ssh; cfg = config.custom.web-services.forgejo.ssh;
in in
{ {
options.custom.services.forgejo.ssh = { options.custom.web-services.forgejo.ssh = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
port = lib.mkOption { port = lib.mkOption {
type = lib.types.port; type = lib.types.port;

View file

@ -5,12 +5,12 @@
... ...
}: }:
let let
cfg = config.custom.services.freshrss; cfg = config.custom.web-services.freshrss;
inherit (config.services.freshrss) dataDir; inherit (config.services.freshrss) dataDir;
in in
{ {
options.custom.services.freshrss = { options.custom.web-services.freshrss = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;

View file

@ -6,11 +6,11 @@
... ...
}: }:
let let
cfg = config.custom.services.gatus; cfg = config.custom.web-services.gatus;
dataDir = "/var/lib/gatus"; dataDir = "/var/lib/gatus";
in in
{ {
options.custom.services.gatus = { options.custom.web-services.gatus = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;
@ -169,8 +169,7 @@ in
systemd.services.gatus.environment.GATUS_DELAY_START_SECONDS = "5"; systemd.services.gatus.environment.GATUS_DELAY_START_SECONDS = "5";
custom = { custom = {
services = { web-services.gatus.endpoints =
gatus.endpoints =
let let
defaultEndpoints = defaultEndpoints =
self.nixosConfigurations self.nixosConfigurations
@ -201,8 +200,7 @@ in
} }
); );
caddy.virtualHosts.${cfg.domain}.port = cfg.port; services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
};
persistence.directories = [ dataDir ]; persistence.directories = [ dataDir ];
}; };

View file

@ -5,10 +5,10 @@
... ...
}: }:
let let
cfg = config.custom.services.grafana; cfg = config.custom.web-services.grafana;
in in
{ {
options.custom.services.grafana = { options.custom.web-services.grafana = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;

View file

@ -5,10 +5,10 @@
... ...
}: }:
let let
cfg = config.custom.services.it-tools; cfg = config.custom.web-services.it-tools;
in in
{ {
options.custom.services.it-tools = { options.custom.web-services.it-tools = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;

View file

@ -5,12 +5,12 @@
... ...
}: }:
let let
cfg = config.custom.services.memos; cfg = config.custom.web-services.memos;
dataDir = config.services.memos.settings.MEMOS_DATA; dataDir = config.services.memos.settings.MEMOS_DATA;
in in
{ {
options.custom.services.memos = { options.custom.web-services.memos = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;

View file

@ -1,9 +1,9 @@
{ config, lib, ... }: { config, lib, ... }:
let let
cfg = config.custom.services.ntfy; cfg = config.custom.web-services.ntfy;
in in
{ {
options.custom.services.ntfy = { options.custom.web-services.ntfy = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;

View file

@ -5,10 +5,10 @@
... ...
}: }:
let let
cfg = config.custom.services.outline; cfg = config.custom.web-services.outline;
in in
{ {
options.custom.services.outline = { options.custom.web-services.outline = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;

View file

@ -5,12 +5,12 @@
... ...
}: }:
let let
cfg = config.custom.services.personal-blog; cfg = config.custom.web-services.personal-blog;
dataDir = "/var/lib/personal-blog"; dataDir = "/var/lib/personal-blog";
in in
{ {
options.custom.services.personal-blog = { options.custom.web-services.personal-blog = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;

View file

@ -1,9 +1,9 @@
{ config, lib, ... }: { config, lib, ... }:
let let
cfg = config.custom.services.privatebin; cfg = config.custom.web-services.privatebin;
in in
{ {
options.custom.services.privatebin = { options.custom.web-services.privatebin = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;

View file

@ -6,12 +6,12 @@
... ...
}: }:
let let
cfg = config.custom.services.radicale; cfg = config.custom.web-services.radicale;
dataDir = config.services.radicale.settings.storage.filesystem_folder; dataDir = config.services.radicale.settings.storage.filesystem_folder;
in in
{ {
options.custom.services.radicale = { options.custom.web-services.radicale = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;

View file

@ -1,9 +1,9 @@
{ config, lib, ... }: { config, lib, ... }:
let let
cfg = config.custom.services.stirling-pdf; cfg = config.custom.web-services.stirling-pdf;
in in
{ {
options.custom.services.stirling-pdf = { options.custom.web-services.stirling-pdf = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;

View file

@ -1,9 +1,9 @@
{ config, lib, ... }: { config, lib, ... }:
let let
cfg = config.custom.services.uptime-kuma; cfg = config.custom.web-services.uptime-kuma;
in in
{ {
options.custom.services.uptime-kuma = { options.custom.web-services.uptime-kuma = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;

View file

@ -5,10 +5,10 @@
... ...
}: }:
let let
cfg = config.custom.services.victorialogs; cfg = config.custom.web-services.victorialogs;
in in
{ {
options.custom.services.victorialogs = { options.custom.web-services.victorialogs = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;

View file

@ -5,10 +5,10 @@
... ...
}: }:
let let
cfg = config.custom.services.victoriametrics; cfg = config.custom.web-services.victoriametrics;
in in
{ {
options.custom.services.victoriametrics = { options.custom.web-services.victoriametrics = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nonEmptyStr;