mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 22:29:06 +01:00
Compare commits
5 commits
fd5acfbcf6
...
993b931b00
| Author | SHA1 | Date | |
|---|---|---|---|
| 993b931b00 | |||
| 1ad5ce0ca0 | |||
| 7fb596cdeb | |||
| fe5113d476 | |||
| b26751a5fb |
24 changed files with 232 additions and 13 deletions
|
|
@ -67,10 +67,9 @@
|
|||
domain = "grafana.${config.custom.networking.overlay.domain}";
|
||||
};
|
||||
|
||||
gatus = {
|
||||
glance = {
|
||||
enable = true;
|
||||
domain = "status.${config.custom.networking.overlay.domain}";
|
||||
generateDefaultEndpoints = true;
|
||||
domain = "home.${config.custom.networking.overlay.domain}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
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 = {
|
||||
title = 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} = {
|
||||
title = "Alertmanager";
|
||||
icon = "sh:prometheus";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,6 +128,13 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
custom.services.caddy.virtualHosts.${cfg.domain}.port = lib.mkIf (cfg.domain != null) cfg.port;
|
||||
custom = {
|
||||
services.caddy.virtualHosts.${cfg.domain}.port = lib.mkIf (cfg.domain != null) cfg.port;
|
||||
|
||||
meta.services.${cfg.domain} = lib.mkIf (cfg.domain != null) {
|
||||
title = "Alloy";
|
||||
icon = "sh:grafana-alloy";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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} = {
|
||||
title = "Prometheus";
|
||||
icon = "sh:prometheus";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,6 +170,11 @@ in
|
|||
};
|
||||
|
||||
persistence.directories = [ dataDir ];
|
||||
|
||||
meta.services.${cfg.gui.domain} = lib.mkIf (cfg.gui.domain != null) {
|
||||
title = "Syncthing";
|
||||
icon = "sh:syncthing";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,11 @@ in
|
|||
};
|
||||
|
||||
persistence.directories = [ dataDir ];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
title = "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} = {
|
||||
title = "Atuin";
|
||||
icon = "sh:atuin";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@ in
|
|||
};
|
||||
|
||||
persistence.directories = [ dataDir ];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
title = "File Browser";
|
||||
icon = "sh:file-browser";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,6 +83,11 @@ in
|
|||
};
|
||||
|
||||
persistence.directories = [ config.services.forgejo.stateDir ];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
title = "Forgejo";
|
||||
icon = "sh:forgejo";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,11 @@ in
|
|||
};
|
||||
|
||||
persistence.directories = [ dataDir ];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
title = "FreshRSS";
|
||||
icon = "sh:freshrss";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,6 +210,11 @@ in
|
|||
services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
|
||||
persistence.directories = [ dataDir ];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
title = "Gatus";
|
||||
icon = "sh:gatus";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
68
modules/nixos/web-services/glance.nix
Normal file
68
modules/nixos/web-services/glance.nix
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
allHosts,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.custom.web-services.glance;
|
||||
|
||||
servicesWidgets =
|
||||
allHosts
|
||||
|> lib.attrValues
|
||||
|> lib.map (host: {
|
||||
hostName = host.config.networking.hostName;
|
||||
services = host.config.custom.meta.services |> lib.attrValues;
|
||||
})
|
||||
|> lib.filter ({ services, ... }: services != [ ])
|
||||
|> lib.map (
|
||||
{ hostName, services }:
|
||||
{
|
||||
type = "monitor";
|
||||
cache = "1m";
|
||||
title = "Services - ${hostName}";
|
||||
sites = services;
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
options.custom.web-services.glance = {
|
||||
enable = lib.mkEnableOption "";
|
||||
domain = lib.mkOption {
|
||||
type = lib.types.nonEmptyStr;
|
||||
default = "";
|
||||
};
|
||||
port = lib.mkOption {
|
||||
type = lib.types.port;
|
||||
default = 63958;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.glance = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
server.port = cfg.port;
|
||||
|
||||
pages = lib.singleton {
|
||||
name = "Home";
|
||||
center-vertically = true;
|
||||
|
||||
columns = lib.singleton {
|
||||
size = "full";
|
||||
widgets =
|
||||
lib.singleton {
|
||||
type = "search";
|
||||
search-engine = "google";
|
||||
autofocus = true;
|
||||
}
|
||||
++ servicesWidgets;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
custom.services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
||||
};
|
||||
}
|
||||
|
|
@ -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} = {
|
||||
title = "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} = {
|
||||
title = "IT-Tools";
|
||||
icon = "sh:it-tools";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,11 @@ in
|
|||
"/var/lib/karakeep"
|
||||
"/var/lib/meilisearch"
|
||||
];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
title = "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} = {
|
||||
title = "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} = {
|
||||
title = "ntfy";
|
||||
icon = "sh:ntfy";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,6 +85,11 @@ in
|
|||
dataDir
|
||||
config.services.postgresql.dataDir
|
||||
];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
title = "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} = {
|
||||
title = "Blog";
|
||||
icon = "sh:hugo";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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} = {
|
||||
title = "PrivateBin";
|
||||
icon = "sh:privatebin";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,6 +109,11 @@ in
|
|||
};
|
||||
|
||||
persistence.directories = [ dataDir ];
|
||||
|
||||
meta.services.${cfg.domain} = {
|
||||
title = "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} = {
|
||||
title = "Screego";
|
||||
icon = "mdi:projector-screen-outline";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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} = {
|
||||
title = "Stirling PDF";
|
||||
icon = "sh:stirling-pdf";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue