mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 23:29:08 +01:00
glance: Improve services
This commit is contained in:
parent
5cfb73e183
commit
5cf56036d7
21 changed files with 161 additions and 20 deletions
27
modules/nixos/meta/services.nix
Normal file
27
modules/nixos/meta/services.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
options.custom.meta.services = lib.mkOption {
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule (
|
||||
{ name, ... }:
|
||||
{
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.nonEmptyStr;
|
||||
default = name;
|
||||
};
|
||||
url = lib.mkOption {
|
||||
type = lib.types.nonEmptyStr;
|
||||
default = "https://${name}";
|
||||
};
|
||||
icon = lib.mkOption {
|
||||
type = lib.types.nonEmptyStr;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
);
|
||||
default = { };
|
||||
};
|
||||
}
|
||||
|
|
@ -98,6 +98,13 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
custom.services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
custom = {
|
||||
services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "Alertmanager";
|
||||
icon = "di:alertmanager";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,6 +125,11 @@ in
|
|||
services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
|
||||
persistence.directories = [ "/var/lib/${config.services.prometheus.stateDir}" ];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "Prometheus";
|
||||
icon = "sh:prometheus";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,11 @@ in
|
|||
};
|
||||
|
||||
persistence.directories = [ dataDir ];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "Actual Budget";
|
||||
icon = "sh:actual-budget";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,11 @@ in
|
|||
services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
|
||||
persistence.directories = [ dataDir ];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "Atuin";
|
||||
icon = "sh:atuin";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@ in
|
|||
};
|
||||
|
||||
persistence.directories = [ dataDir ];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "File Browser";
|
||||
icon = "sh:filebrowser";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,6 +83,11 @@ in
|
|||
};
|
||||
|
||||
persistence.directories = [ config.services.forgejo.stateDir ];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "Forgejo";
|
||||
icon = "sh:forgejo";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,11 @@ in
|
|||
};
|
||||
|
||||
persistence.directories = [ dataDir ];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "FreshRSS";
|
||||
icon = "sh:freshrss";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,6 +210,11 @@ in
|
|||
services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
|
||||
persistence.directories = [ dataDir ];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "Gatus";
|
||||
icon = "sh:gatus";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,22 +35,16 @@ in
|
|||
|> lib.attrValues
|
||||
|> lib.map (host: {
|
||||
hostName = host.config.networking.hostName;
|
||||
domains =
|
||||
host.config.custom.services.caddy.virtualHosts |> lib.attrValues |> lib.map (vHost: vHost.domain);
|
||||
services = host.config.custom.meta.services |> lib.attrValues;
|
||||
})
|
||||
|> lib.filter ({ domains, ... }: domains != [ ])
|
||||
|> lib.filter ({ services, ... }: services != [ ])
|
||||
|> lib.map (
|
||||
{ hostName, domains }:
|
||||
{ hostName, services }:
|
||||
{
|
||||
type = "monitor";
|
||||
cache = "1m";
|
||||
title = "Services - ${hostName}";
|
||||
sites =
|
||||
domains
|
||||
|> lib.map (domain: {
|
||||
title = domain;
|
||||
url = "https://${domain}";
|
||||
});
|
||||
sites = services;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
|
@ -58,6 +52,13 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
custom.services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
custom = {
|
||||
services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "Glance";
|
||||
icon = "sh:glance";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,6 +85,13 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
custom.services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
custom = {
|
||||
services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "Grafana";
|
||||
icon = "sh:grafana";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,13 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
custom.services.caddy.virtualHosts.${cfg.domain}.files = "${pkgs.it-tools}/lib";
|
||||
custom = {
|
||||
services.caddy.virtualHosts.${cfg.domain}.files = "${pkgs.it-tools}/lib";
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "IT-Tools";
|
||||
icon = "sh:it-tools";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,11 @@ in
|
|||
"/var/lib/karakeep"
|
||||
"/var/lib/meilisearch"
|
||||
];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "Karakeep";
|
||||
icon = "sh:karakeep";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,13 @@ in
|
|||
pull = "newer";
|
||||
};
|
||||
|
||||
custom.services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
custom = {
|
||||
services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "Networking Toolbox";
|
||||
icon = "sh:networking-toolbox";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,13 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
custom.services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
custom = {
|
||||
services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "ntfy";
|
||||
icon = "sh:ntfy";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,6 +85,11 @@ in
|
|||
dataDir
|
||||
config.services.postgresql.dataDir
|
||||
];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "Outline";
|
||||
icon = "sh:outline";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,13 @@ in
|
|||
script = "nix build github:SebastianStork/blog --out-link ${dataDir} --refresh";
|
||||
};
|
||||
|
||||
custom.services.caddy.virtualHosts.${cfg.domain}.files = dataDir;
|
||||
custom = {
|
||||
services.caddy.virtualHosts.${cfg.domain}.files = dataDir;
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "Blog";
|
||||
icon = "sh:ghost";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,13 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
custom.services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
custom = {
|
||||
services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "PrivateBin";
|
||||
icon = "sh:privatebin";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,6 +109,11 @@ in
|
|||
};
|
||||
|
||||
persistence.directories = [ dataDir ];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "Radicale";
|
||||
icon = "sh:radicale";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,13 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
custom.services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
custom = {
|
||||
services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "Screego";
|
||||
icon = "sh:screego";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,13 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
custom.services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
custom = {
|
||||
services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
name = "Stirling PDF";
|
||||
icon = "sh:stirling-pdf";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue