mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2025-12-31 04:38:23 +01:00
topology: extend some more
This commit is contained in:
13
topology/service-extractors/gitea-runners.nix
Normal file
13
topology/service-extractors/gitea-runners.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ config, unstablePkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.services.gitea-actions-runner;
|
||||
in
|
||||
{
|
||||
config.topology.self.services = lib.mapAttrs' (name: instance: {
|
||||
name = "gitea-runner-${name}";
|
||||
value = {
|
||||
name = "Gitea runner ${name}";
|
||||
icon = "services.gitea";
|
||||
};
|
||||
}) (lib.filterAttrs (_: instance: instance.enable) cfg.instances);
|
||||
}
|
||||
19
topology/service-extractors/mysql.nix
Normal file
19
topology/service-extractors/mysql.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ config, unstablePkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.services.mysql;
|
||||
cfgBak = config.services.mysqlBackup;
|
||||
in
|
||||
{
|
||||
config.topology.self.services.mysql = lib.mkIf cfg.enable {
|
||||
name = "MySQL";
|
||||
icon = "${unstablePkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/mysql.svg";
|
||||
|
||||
details.listen.text = "${cfg.settings.mysqld.bind-address or "127.0.0.1"}:${toString (cfg.settings.mysqld.port or 3306)}";
|
||||
details.socket.text = cfg.settings.mysqld.socket or "/run/mysqld/mysqld.sock";
|
||||
details.type.text = cfg.package.pname;
|
||||
details.dataDir.text = cfg.dataDir;
|
||||
|
||||
# details.backup-time = lib.mkIf cfgBak.enable cfgBak.calendar;
|
||||
# details.backup-location = lib.mkIf cfgBak.enable cfgBak.location;
|
||||
};
|
||||
}
|
||||
19
topology/service-extractors/postgresql.nix
Normal file
19
topology/service-extractors/postgresql.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ config, unstablePkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.services.postgresql;
|
||||
cfgBak = config.services.postgresqlBackup;
|
||||
in
|
||||
{
|
||||
config.topology.self.services.postgresql = lib.mkIf cfg.enable {
|
||||
name = "PostgreSQL";
|
||||
icon = "${unstablePkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/postgresql.svg";
|
||||
|
||||
details.listen.text = lib.mkIf cfg.enableTCPIP "0.0.0.0:${toString cfg.settings.port}";
|
||||
details.socket.text = "/run/postgresql/.s.PGSQL.${toString cfg.settings.port}";
|
||||
details.version.text = cfg.package.version;
|
||||
details.dataDir.text = cfg.dataDir;
|
||||
|
||||
# details.backup-time = lib.mkIf cfgBak.enable cfgBak.startAt;
|
||||
# details.backup-location = lib.mkIf cfgBak.enable cfgBak.location;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user