Compare commits

...

3 Commits

Author SHA1 Message Date
h7x4
4abe86dc07 base/roowho2: traffic filter to PVV IP-space 2026-01-06 12:23:39 +09:00
h7x4
25c8171e3d base/roowho2: init 2026-01-06 12:23:39 +09:00
h7x4
7cff6b197c topology: extend some more 2025-12-31 03:42:26 +09:00
9 changed files with 187 additions and 2 deletions

View File

@@ -16,7 +16,6 @@
./flake-input-exporter.nix
./services/acme.nix
./services/uptimed.nix
./services/auto-upgrade.nix
./services/dbus.nix
./services/fwupd.nix
@@ -28,8 +27,10 @@
./services/prometheus-node-exporter.nix
./services/prometheus-systemd-exporter.nix
./services/promtail.nix
./services/roowho2.nix
./services/smartd.nix
./services/thermald.nix
./services/uptimed.nix
./services/userborn.nix
./services/userdbd.nix
];

12
base/services/roowho2.nix Normal file
View File

@@ -0,0 +1,12 @@
{ lib, values, ... }:
{
services.roowho2.enable = lib.mkDefault true;
systemd.sockets.roowho2-rwhod.socketConfig = {
IPAddressDeny = "any";
IPAddressAllow = [
"127.0.0.1"
values.ipv4-space
];
};
}

44
flake.lock generated
View File

@@ -381,9 +381,32 @@
"nixpkgs-unstable": "nixpkgs-unstable",
"pvv-calendar-bot": "pvv-calendar-bot",
"pvv-nettsiden": "pvv-nettsiden",
"roowho2": "roowho2",
"sops-nix": "sops-nix"
}
},
"roowho2": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay_3"
},
"locked": {
"lastModified": 1767669800,
"narHash": "sha256-b1r1VSDBTRuxYHZVV4his8KhafAqNcWlAZBLOX1UORg=",
"ref": "main",
"rev": "369d37513c85855751f406191fbd493a2461f072",
"revCount": 33,
"type": "git",
"url": "https://git.pvv.ntnu.no/Projects/roowho2.git"
},
"original": {
"ref": "main",
"type": "git",
"url": "https://git.pvv.ntnu.no/Projects/roowho2.git"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
@@ -426,6 +449,27 @@
"type": "github"
}
},
"rust-overlay_3": {
"inputs": {
"nixpkgs": [
"roowho2",
"nixpkgs"
]
},
"locked": {
"lastModified": 1767322002,
"narHash": "sha256-yHKXXw2OWfIFsyTjduB4EyFwR0SYYF0hK8xI9z4NIn0=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "03c6e38661c02a27ca006a284813afdc461e9f7e",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [

View File

@@ -29,6 +29,9 @@
minecraft-heatmap.url = "git+https://git.pvv.ntnu.no/Projects/minecraft-heatmap.git?ref=main";
minecraft-heatmap.inputs.nixpkgs.follows = "nixpkgs";
roowho2.url = "git+https://git.pvv.ntnu.no/Projects/roowho2.git?ref=main";
roowho2.inputs.nixpkgs.follows = "nixpkgs";
greg-ng.url = "git+https://git.pvv.ntnu.no/Grzegorz/greg-ng.git?ref=main";
greg-ng.inputs.nixpkgs.follows = "nixpkgs";
gergle.url = "git+https://git.pvv.ntnu.no/Grzegorz/gergle.git?ref=main";
@@ -93,6 +96,7 @@
modules = [
configurationPath
sops-nix.nixosModules.sops
inputs.roowho2.nixosModules.default
] ++ extraArgs.modules or [];
pkgs = import nixpkgs {
@@ -104,6 +108,7 @@
];
overlays = [
# Global overlays go here
inputs.roowho2.overlays.default
] ++ extraArgs.overlays or [ ];
};
})
@@ -261,7 +266,12 @@
topology' = import inputs.nix-topology {
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [ inputs.nix-topology.overlays.default ];
overlays = [
inputs.nix-topology.overlays.default
(final: prev: {
inherit (nixpkgs-unstable.legacyPackages.x86_64-linux) super-tiny-icons;
})
];
};
specialArgs = {
@@ -275,6 +285,9 @@
modules = [
inputs.nix-topology.nixosModules.default
./topology/service-extractors/greg-ng.nix
./topology/service-extractors/postgresql.nix
./topology/service-extractors/mysql.nix
./topology/service-extractors/gitea-runners.nix
];
}) self.nixosConfigurations;
}

View File

@@ -103,11 +103,26 @@ in {
);
};
nodes.bekkalokk.hardware.info = "Supermicro X9SCL/X9SCM";
nodes.lupine-1.hardware.info = "Dell OptiPlex 7040";
# nodes.lupine-2.hardware.info = "Dell OptiPlex 5050";
nodes.lupine-3.hardware.info = "Dell OptiPlex 5050";
nodes.lupine-4.hardware.info = "Dell OptiPlex 5050";
# nodes.lupine-5.hardware.info = "Dell OptiPlex 5050";
nodes.buskerud = mkDevice "buskerud" {
deviceIcon = ./icons/proxmox.svg;
interfaceGroups = [ [ "eth1" ] ];
interfaces.eth1.network = "pvv";
services = {
proxmox = {
name = "Proxmox web interface";
info = "https://buskerud.pvv.ntnu.no:8006/";
};
};
};
nodes.shark = {
@@ -125,6 +140,15 @@ in {
hardware.info = "Dell PowerEdge R730 x 3";
interfaceGroups = [ [ "eth1" ] ];
services = {
proxmox = {
name = "Proxmox web interface";
details.bubbles.text = "https://bubbles.pvv.ntnu.no:8006/";
details.blossom.text = "https://blossom.pvv.ntnu.no:8006/";
details.buttercup.text = "https://buttercup.pvv.ntnu.no:8006/";
};
};
};
nodes.kommode = {

View File

@@ -120,6 +120,30 @@ in {
values.hosts.gateway6
];
};
services = {
dovecot = {
name = "Dovecot";
info = "imap.pvv.ntnu.no pop.pvv.ntnu.no";
icon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/dovecot.svg";
details.imap.text = "0.0.0.0:993";
details.pop3.text = "0.0.0.0:995";
};
exim4 = {
name = "Exim4";
info = "mail.pvv.ntnu.no mailhost.pvv.ntnu.no";
details.smtp.text = "0.0.0.0:25";
details.smtps.text = "0.0.0.0:465";
details.starttls.text = "0.0.0.0:587";
};
nfs = {
name = "NFS";
info = "homepvv.pvv.ntnu.no";
details.rpcbind.text = "0.0.0.0:111";
};
};
};
nodes.innovation = mkDevice "innovation" {
@@ -145,6 +169,7 @@ in {
icon = "services.minecraft";
info = "minecraft.pvv.ntnu.no";
details.listen.text = "0.0.0.0:25565";
details.directory.text = "/srv/minecraft-pvv";
};
};
};
@@ -220,11 +245,26 @@ in {
values.hosts.gateway6
];
};
services = {
mapcrafter = {
name = "Mapcrafter Minecraft Map";
info = "http://isvegg.pvv.ntnu.no/kart/";
details.directory.text = "/scratch/mckart/kart";
};
gophernicus = {
name = "Gophernicus";
info = "gopher://gopher.pvv.ntnu.no/";
details.directory.text = "/var/gopher";
};
};
};
nodes.ameno = mkDevice "ameno" {
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/ubuntu.svg";
hardware.info = "Raspberry Pi 2B 1.1";
interfaceGroups = [ [ "eth0" ] ];
interfaces.eth0 = {
mac = "b8:27:eb:62:1d:d8";

View 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);
}

View 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;
};
}

View 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;
};
}