mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2025-12-31 12:48:23 +01:00
Compare commits
9 Commits
gitea-robo
...
fix-bluema
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba73075ed3 | ||
|
|
c0000a1eb6 | ||
|
|
243b665eae | ||
|
|
ab5be48b1c | ||
|
|
f671db8a12 | ||
|
|
ad61336a20 | ||
|
|
197433a4c3 | ||
|
|
58be01e620 | ||
|
|
0f72ea9241 |
32
.gitea/workflows/build-topology-graph.yml
Normal file
32
.gitea/workflows/build-topology-graph.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
name: "Build topology graph"
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
jobs:
|
||||
evals:
|
||||
runs-on: debian-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install sudo
|
||||
run: apt-get update && apt-get -y install sudo
|
||||
|
||||
- uses: https://github.com/cachix/install-nix-action@v31
|
||||
|
||||
- name: Configure Nix
|
||||
run: echo -e "show-trace = true\nmax-jobs = auto\ntrusted-users = root\nexperimental-features = nix-command flakes\nbuild-users-group =" > /etc/nix/nix.conf
|
||||
|
||||
- name: Build topology graph
|
||||
run: nix build .#topology -L
|
||||
|
||||
- name: Upload topology graph
|
||||
uses: https://git.pvv.ntnu.no/Projects/rsync-action@v2
|
||||
with:
|
||||
source: result/*.svg
|
||||
quote-source: false
|
||||
target: ${{ gitea.ref_name }}/topology_graph/
|
||||
username: gitea-web
|
||||
ssh-key: ${{ secrets.WEB_SYNC_SSH_KEY }}
|
||||
host: pages.pvv.ntnu.no
|
||||
known-hosts: "pages.pvv.ntnu.no ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH2QjfFB+city1SYqltkVqWACfo1j37k+oQQfj13mtgg"
|
||||
168
flake.lock
generated
168
flake.lock
generated
@@ -1,5 +1,26 @@
|
||||
{
|
||||
"nodes": {
|
||||
"devshell": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nix-topology",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1728330715,
|
||||
"narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=",
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "devshell",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"disko": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -21,6 +42,40 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1726560853,
|
||||
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gergle": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -42,6 +97,28 @@
|
||||
"url": "https://git.pvv.ntnu.no/Grzegorz/gergle.git"
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nix-topology",
|
||||
"pre-commit-hooks",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1709087332,
|
||||
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"greg-ng": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -170,13 +247,37 @@
|
||||
"url": "https://git.pvv.ntnu.no/Drift/nix-gitea-themes.git"
|
||||
}
|
||||
},
|
||||
"nix-topology": {
|
||||
"inputs": {
|
||||
"devshell": "devshell",
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"pre-commit-hooks": "pre-commit-hooks"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1765969653,
|
||||
"narHash": "sha256-qVpQxyvdByeDfb+d+jhbyNna2Ie+w85iHpt4Qu0rv/E=",
|
||||
"owner": "oddlama",
|
||||
"repo": "nix-topology",
|
||||
"rev": "0ed73e5a1b65eb8ed388d070ebe8dedb9182f466",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "oddlama",
|
||||
"ref": "main",
|
||||
"repo": "nix-topology",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1764806471,
|
||||
"narHash": "sha256-Qk0SArnS83KqyS9wNt1YoTkkYKDraNrjRWKUtB9DKoM=",
|
||||
"rev": "6707b1809330d0f912f5813963bb29f6f194ee81",
|
||||
"lastModified": 1767043167,
|
||||
"narHash": "sha256-wN04/SL+8tV0D2HBIgt9dpX/03U18xoJ+8PT+dcn30E=",
|
||||
"rev": "0b43a6ee07997a6e319e92dcbf276c2736506944",
|
||||
"type": "tarball",
|
||||
"url": "https://releases.nixos.org/nixos/25.11-small/nixos-25.11.896.6707b1809330/nixexprs.tar.xz"
|
||||
"url": "https://releases.nixos.org/nixos/25.11-small/nixos-25.11.2789.0b43a6ee0799/nixexprs.tar.xz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
@@ -185,17 +286,44 @@
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1764854611,
|
||||
"narHash": "sha256-MVzFp4ZKwdh6U1wy4fJe/GY3Hb4cvvyJbAZOhaeBQoo=",
|
||||
"rev": "3a4b875aef660bbd148e86b92cffea2a360c3275",
|
||||
"lastModified": 1767031366,
|
||||
"narHash": "sha256-SJz8tVEnXusU8OzN5ixAXQgzXv8fNIzp9ztzUyobh4s=",
|
||||
"rev": "d23fedd87fcd067b1d160323fae0d0e4f995527d",
|
||||
"type": "tarball",
|
||||
"url": "https://releases.nixos.org/nixos/unstable-small/nixos-26.05pre906534.3a4b875aef66/nixexprs.tar.xz"
|
||||
"url": "https://releases.nixos.org/nixos/unstable-small/nixos-26.05pre918279.d23fedd87fcd/nixexprs.tar.xz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://nixos.org/channels/nixos-unstable-small/nixexprs.tar.xz"
|
||||
}
|
||||
},
|
||||
"pre-commit-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"gitignore": "gitignore",
|
||||
"nixpkgs": [
|
||||
"nix-topology",
|
||||
"nixpkgs"
|
||||
],
|
||||
"nixpkgs-stable": [
|
||||
"nix-topology",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1730797577,
|
||||
"narHash": "sha256-SrID5yVpyUfknUTGWgYkTyvdr9J1LxUym4om3SVGPkg=",
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"rev": "1864030ed24a2b8b4e4d386a5eeaf0c5369e50a9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pvv-calendar-bot": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -224,11 +352,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1765978548,
|
||||
"narHash": "sha256-VDSPpw+/Mgo+JujoW12CRlkTs9o0tX/FEL2AR5kl5+Q=",
|
||||
"lastModified": 1767080188,
|
||||
"narHash": "sha256-BmyPuWeSQ9XREyi0KSerWRfJndmyzHNJLysBJld/KwA=",
|
||||
"ref": "main",
|
||||
"rev": "961f021d27f86b2aedd16290dbf85bdd9d50fd42",
|
||||
"revCount": 532,
|
||||
"rev": "08a216f4473e26aa2a5349e72633c0ab24e8ffbd",
|
||||
"revCount": 534,
|
||||
"type": "git",
|
||||
"url": "https://git.pvv.ntnu.no/Projects/nettsiden.git"
|
||||
},
|
||||
@@ -248,6 +376,7 @@
|
||||
"minecraft-heatmap": "minecraft-heatmap",
|
||||
"minecraft-kartverket": "minecraft-kartverket",
|
||||
"nix-gitea-themes": "nix-gitea-themes",
|
||||
"nix-topology": "nix-topology",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"pvv-calendar-bot": "pvv-calendar-bot",
|
||||
@@ -317,6 +446,21 @@
|
||||
"repo": "sops-nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
||||
56
flake.nix
56
flake.nix
@@ -11,6 +11,9 @@
|
||||
disko.url = "github:nix-community/disko/v1.11.0";
|
||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
nix-topology.url = "github:oddlama/nix-topology/main";
|
||||
nix-topology.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
pvv-nettsiden.url = "git+https://git.pvv.ntnu.no/Projects/nettsiden.git?ref=main";
|
||||
pvv-nettsiden.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
@@ -150,12 +153,6 @@
|
||||
self.nixosModules.bluemap
|
||||
];
|
||||
};
|
||||
bob = stableNixosConfig "bob" {
|
||||
modules = [
|
||||
disko.nixosModules.disko
|
||||
{ disko.devices.disk.disk1.device = "/dev/vda"; }
|
||||
];
|
||||
};
|
||||
ildkule = stableNixosConfig "ildkule" { };
|
||||
#ildkule-unstable = unstableNixosConfig "ildkule" { };
|
||||
shark = stableNixosConfig "shark" { };
|
||||
@@ -167,7 +164,6 @@
|
||||
];
|
||||
modules = [
|
||||
inputs.nix-gitea-themes.nixosModules.default
|
||||
self.nixosModules.robots-txt
|
||||
];
|
||||
};
|
||||
|
||||
@@ -247,14 +243,54 @@
|
||||
bluemap = pkgs.callPackage ./packages/bluemap.nix { };
|
||||
|
||||
out-of-your-element = pkgs.callPackage ./packages/out-of-your-element.nix { };
|
||||
} //
|
||||
}
|
||||
//
|
||||
# Mediawiki extensions
|
||||
(lib.pipe null [
|
||||
(_: pkgs.callPackage ./packages/mediawiki-extensions { })
|
||||
(lib.flip builtins.removeAttrs ["override" "overrideDerivation"])
|
||||
(lib.mapAttrs' (name: lib.nameValuePair "mediawiki-${name}"))
|
||||
])
|
||||
// lib.genAttrs allMachines
|
||||
(machine: self.nixosConfigurations.${machine}.config.system.build.toplevel);
|
||||
//
|
||||
# Machines
|
||||
lib.genAttrs allMachines
|
||||
(machine: self.nixosConfigurations.${machine}.config.system.build.toplevel)
|
||||
//
|
||||
# Nix-topology
|
||||
(let
|
||||
topology' = import inputs.nix-topology {
|
||||
pkgs = import nixpkgs {
|
||||
system = "x86_64-linux";
|
||||
overlays = [ inputs.nix-topology.overlays.default ];
|
||||
};
|
||||
|
||||
specialArgs = {
|
||||
values = import ./values.nix;
|
||||
};
|
||||
|
||||
modules = [
|
||||
./topology
|
||||
{
|
||||
nixosConfigurations = lib.mapAttrs (_name: nixosCfg: nixosCfg.extendModules {
|
||||
modules = [
|
||||
inputs.nix-topology.nixosModules.default
|
||||
./topology/service-extractors/greg-ng.nix
|
||||
];
|
||||
}) self.nixosConfigurations;
|
||||
}
|
||||
];
|
||||
};
|
||||
in {
|
||||
topology = topology'.config.output;
|
||||
topology-png = pkgs.runCommand "pvv-config-topology-png" {
|
||||
nativeBuildInputs = [ pkgs.writableTmpDirAsHomeHook ];
|
||||
} ''
|
||||
mkdir -p "$out"
|
||||
for file in '${topology'.config.output}'/*.svg; do
|
||||
${lib.getExe pkgs.imagemagick} -density 300 -background none "$file" "$out"/"$(basename "''${file%.svg}.png")"
|
||||
done
|
||||
'';
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -58,7 +58,11 @@ in {
|
||||
max-y = 90;
|
||||
}];
|
||||
marker-sets = {
|
||||
_includes = [ (format.lib.mkInclude "${bluemap-export}/nether.hocon") ];
|
||||
_includes = [ (format.lib.mkInclude {
|
||||
required = true;
|
||||
type = "file";
|
||||
value = "${bluemap-export}/nether.hocon";
|
||||
}) ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -193,109 +193,6 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
environment.robots-txt."gitea" = {
|
||||
virtualHost = domain;
|
||||
rules = [
|
||||
{
|
||||
pre_comment = ''
|
||||
Gitea internals
|
||||
|
||||
See these for more information:
|
||||
- https://gitea.com/robots.txt
|
||||
- https://codeberg.org/robots.txt
|
||||
'';
|
||||
User-agent = "*";
|
||||
Disallow = [
|
||||
"/api/*"
|
||||
"/avatars"
|
||||
"/*/*/src/commit/*"
|
||||
"/*/*/commit/*"
|
||||
"/*/*/*/refs/*"
|
||||
"/*/*/*/star"
|
||||
"/*/*/*/watch"
|
||||
"/*/*/labels"
|
||||
"/*/*/activity/*"
|
||||
"/vendor/*"
|
||||
"/swagger.*.json"
|
||||
"/repo/create"
|
||||
"/repo/migrate"
|
||||
"/org/create"
|
||||
"/*/*/fork"
|
||||
"/*/*/watchers"
|
||||
"/*/*/stargazers"
|
||||
"/*/*/forks"
|
||||
"*/.git/"
|
||||
"/*.git"
|
||||
"/*.atom"
|
||||
"/*.rss"
|
||||
];
|
||||
}
|
||||
{
|
||||
pre_comment = "Language Spam";
|
||||
Disallow = "/*?lang=";
|
||||
}
|
||||
{
|
||||
pre_comment = ''
|
||||
AI bots
|
||||
|
||||
Sourced from:
|
||||
- https://www.vg.no/robots.txt
|
||||
- https://codeberg.org/robots.txt
|
||||
'';
|
||||
User-agent = [
|
||||
"AI2Bot"
|
||||
"Ai2Bot-Dolma"
|
||||
"Amazonbot"
|
||||
"Applebot-Extended"
|
||||
"Bytespider"
|
||||
"CCBot"
|
||||
"ChatGPT-User"
|
||||
"Claude-Web"
|
||||
"ClaudeBot"
|
||||
"Crawlspace"
|
||||
"Diffbot"
|
||||
"FacebookBot"
|
||||
"FriendlyCrawler"
|
||||
"GPTBot"
|
||||
"Google-Extended"
|
||||
"ICC-Crawler"
|
||||
"ImagesiftBot"
|
||||
"Kangaroo Bot"
|
||||
"Meta-ExternalAgent"
|
||||
"OAI-SearchBot"
|
||||
"Omgili"
|
||||
"Omgilibot"
|
||||
"PanguBot"
|
||||
"PerplexityBot"
|
||||
"PetalBot"
|
||||
"Scrapy"
|
||||
"SemrushBot-OCOB"
|
||||
"Sidetrade indexer bot"
|
||||
"Timpibot"
|
||||
"VelenPublicWebCrawler"
|
||||
"Webzio-Extended"
|
||||
"YouBot"
|
||||
"anthropic-ai"
|
||||
"cohere-ai"
|
||||
"cohere-training-data-crawler"
|
||||
"facebookexternalhit"
|
||||
"iaskspider/2.0"
|
||||
"img2dataset"
|
||||
"meta-externalagent"
|
||||
"omgili"
|
||||
"omgilibot"
|
||||
];
|
||||
Disallow = "/";
|
||||
}
|
||||
{
|
||||
Crawl-delay = "2";
|
||||
}
|
||||
{
|
||||
Sitemap = "https://${domain}/sitemap.xml";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ sshPort ];
|
||||
|
||||
systemd.services.gitea-dump = {
|
||||
|
||||
240
topology/default.nix
Normal file
240
topology/default.nix
Normal file
@@ -0,0 +1,240 @@
|
||||
{ config, pkgs, lib, values, ... }:
|
||||
let
|
||||
inherit
|
||||
(config.lib.topology)
|
||||
mkInternet
|
||||
mkRouter
|
||||
mkSwitch
|
||||
mkDevice
|
||||
mkConnection
|
||||
mkConnectionRev;
|
||||
in {
|
||||
imports = [
|
||||
./non-nixos-machines.nix
|
||||
];
|
||||
|
||||
### Networks
|
||||
|
||||
networks.pvv = {
|
||||
name = "PVV Network";
|
||||
cidrv4 = values.ipv4-space;
|
||||
cidrv6 = values.ipv6-space;
|
||||
};
|
||||
|
||||
networks.site-vpn = {
|
||||
name = "OpenVPN Site to Site";
|
||||
style = {
|
||||
primaryColor = "#9dd68d";
|
||||
secondaryColor = null;
|
||||
pattern = "dashed";
|
||||
};
|
||||
};
|
||||
|
||||
networks.ntnu = {
|
||||
name = "NTNU";
|
||||
cidrv4 = values.ntnu.ipv4-space;
|
||||
cidrv6 = values.ntnu.ipv6-space;
|
||||
};
|
||||
|
||||
nodes.internet = mkInternet {
|
||||
connections = mkConnection "ntnu" "wan1";
|
||||
};
|
||||
|
||||
nodes.ntnu = mkRouter "NTNU" {
|
||||
interfaceGroups = [ ["wan1"] ["eth1" "eth2" "eth3"] ];
|
||||
connections.eth1 = mkConnection "ntnu-pvv-router" "wan1";
|
||||
connections.eth2 = mkConnection "ntnu-veggen" "wan1";
|
||||
connections.eth3 = mkConnection "stackit" "*";
|
||||
interfaces.eth1.network = "ntnu";
|
||||
};
|
||||
|
||||
### Brus
|
||||
|
||||
nodes.ntnu-pvv-router = mkRouter "NTNU PVV Gateway" {
|
||||
interfaceGroups = [ ["wan1"] ["eth1"] ];
|
||||
connections.eth1 = mkConnection "knutsen" "em1";
|
||||
interfaces.eth1.network = "pvv";
|
||||
};
|
||||
|
||||
nodes.knutsen = mkRouter "knutsen" {
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/freebsd.svg";
|
||||
|
||||
interfaceGroups = [ ["em0"] ["em1"] ["vpn1"] ];
|
||||
|
||||
connections.em0 = mkConnection "nintendo" "eth0";
|
||||
|
||||
# connections.vpn1 = mkConnection "ludvigsen" "vpn1";
|
||||
interfaces.vpn1.network = "site-vpn";
|
||||
interfaces.vpn1.virtual = true;
|
||||
interfaces.vpn1.icon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/openvpn.svg";
|
||||
|
||||
interfaces.em0.network = "pvv";
|
||||
interfaces.em1.network = "ntnu";
|
||||
};
|
||||
|
||||
nodes.nintendo = mkSwitch "Nintendo (brus switch)" {
|
||||
interfaceGroups = [ (lib.genList (i: "eth${toString i}") 16) ];
|
||||
|
||||
connections = let
|
||||
connections' = [
|
||||
(mkConnection "bekkalokk" "enp2s0")
|
||||
# (mkConnection "bicep" "enp6s0f0") # NOTE: physical machine is dead at the moment
|
||||
(mkConnection "buskerud" "eth1")
|
||||
# (mkConnection "knutsen" "eth1")
|
||||
(mkConnection "powerpuff-cluster" "eth1")
|
||||
(mkConnection "lupine-1" "enp0s31f6")
|
||||
(mkConnection "lupine-2" "enp0s31f6")
|
||||
(mkConnection "lupine-3" "enp0s31f6")
|
||||
(mkConnection "lupine-4" "enp0s31f6")
|
||||
(mkConnection "lupine-5" "enp0s31f6")
|
||||
(mkConnection "innovation" "em0")
|
||||
(mkConnection "microbel" "eth0")
|
||||
(mkConnection "isvegg" "eth0")
|
||||
(mkConnection "ameno" "eth0")
|
||||
(mkConnection "sleipner" "eno0")
|
||||
];
|
||||
in
|
||||
assert (lib.length connections' <= 15);
|
||||
builtins.listToAttrs (
|
||||
lib.zipListsWith
|
||||
(a: b: lib.nameValuePair a b)
|
||||
(lib.genList (i: "eth${toString (i + 1)}") 15)
|
||||
connections'
|
||||
);
|
||||
};
|
||||
|
||||
nodes.buskerud = mkDevice "buskerud" {
|
||||
deviceIcon = ./icons/proxmox.svg;
|
||||
interfaceGroups = [ [ "eth1" ] ];
|
||||
|
||||
interfaces.eth1.network = "pvv";
|
||||
};
|
||||
|
||||
nodes.shark = {
|
||||
guestType = "proxmox";
|
||||
parent = config.nodes.buskerud.id;
|
||||
|
||||
interfaces.ens18.network = "pvv";
|
||||
};
|
||||
|
||||
### Powerpuff
|
||||
|
||||
nodes.powerpuff-cluster = mkDevice "Powerpuff Cluster" {
|
||||
deviceIcon = ./icons/proxmox.svg;
|
||||
|
||||
hardware.info = "Dell PowerEdge R730 x 3";
|
||||
|
||||
interfaceGroups = [ [ "eth1" ] ];
|
||||
};
|
||||
|
||||
nodes.kommode = {
|
||||
guestType = "proxmox";
|
||||
parent = config.nodes.powerpuff-cluster.id;
|
||||
|
||||
interfaces.ens18.network = "pvv";
|
||||
};
|
||||
|
||||
nodes.bicep = {
|
||||
guestType = "proxmox";
|
||||
parent = config.nodes.powerpuff-cluster.id;
|
||||
|
||||
# hardware.info = "HP Proliant DL370G6";
|
||||
|
||||
interfaces.ens18.network = "pvv";
|
||||
};
|
||||
|
||||
nodes.ustetind = {
|
||||
guestType = "proxmox LXC";
|
||||
parent = config.nodes.powerpuff-cluster.id;
|
||||
|
||||
# TODO: the interface name is likely wrong
|
||||
# interfaceGroups = [ [ "eth0" ] ];
|
||||
interfaces.eth0 = {
|
||||
network = "pvv";
|
||||
# mac = "";
|
||||
addresses = [
|
||||
"129.241.210.234"
|
||||
"2001:700:300:1900::234"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
### PVV
|
||||
|
||||
nodes.ntnu-veggen = mkRouter "NTNU-Veggen" {
|
||||
interfaceGroups = [ ["wan1"] ["eth1"] ];
|
||||
connections.eth1 = mkConnection "ludvigsen" "re0";
|
||||
};
|
||||
|
||||
nodes.ludvigsen = mkRouter "ludvigsen" {
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/freebsd.svg";
|
||||
|
||||
interfaceGroups = [ [ "re0" ] [ "em0" ] [ "vpn1" ] ];
|
||||
|
||||
connections.em0 = mkConnection "pvv-switch" "eth0";
|
||||
|
||||
interfaces.vpn1.network = "site-vpn";
|
||||
interfaces.vpn1.virtual = true;
|
||||
interfaces.vpn1.icon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/openvpn.svg";
|
||||
|
||||
interfaces.re0.network = "ntnu";
|
||||
interfaces.em0.network = "pvv";
|
||||
};
|
||||
|
||||
nodes.pvv-switch = mkSwitch "PVV Switch (Terminalrommet)" {
|
||||
interfaceGroups = [ (lib.genList (i: "eth${toString i}") 16) ];
|
||||
connections = let
|
||||
connections' = [
|
||||
(mkConnection "brzeczyszczykiewicz" "eno1")
|
||||
(mkConnection "georg" "eno1")
|
||||
(mkConnection "wegonke" "enp4s0")
|
||||
(mkConnection "demiurgen" "eno1")
|
||||
(mkConnection "sanctuary" "ethernet_0")
|
||||
(mkConnection "torskas" "eth0")
|
||||
(mkConnection "skrott" "eth0")
|
||||
(mkConnection "homeassistant" "eth0")
|
||||
(mkConnection "orchid" "eth0")
|
||||
(mkConnection "principal" "em0")
|
||||
];
|
||||
in
|
||||
assert (lib.length connections' <= 15);
|
||||
builtins.listToAttrs (
|
||||
lib.zipListsWith
|
||||
(a: b: lib.nameValuePair a b)
|
||||
(lib.genList (i: "eth${toString (i + 1)}") 15)
|
||||
connections'
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
### Openstack
|
||||
|
||||
nodes.stackit = mkDevice "stackit" {
|
||||
interfaceGroups = [ [ "*" ] ];
|
||||
|
||||
interfaces."*".network = "ntnu";
|
||||
};
|
||||
|
||||
nodes.ildkule = {
|
||||
guestType = "openstack";
|
||||
parent = config.nodes.stackit.id;
|
||||
|
||||
interfaces.ens4.network = "ntnu";
|
||||
};
|
||||
nodes.wenche = {
|
||||
guestType = "openstack";
|
||||
parent = config.nodes.stackit.id;
|
||||
|
||||
interfaces.ens18.network = "pvv";
|
||||
};
|
||||
nodes.bakke = {
|
||||
guestType = "openstack";
|
||||
parent = config.nodes.stackit.id;
|
||||
|
||||
interfaces.enp2s0.network = "pvv";
|
||||
};
|
||||
}
|
||||
BIN
topology/icons/bind9.png
Normal file
BIN
topology/icons/bind9.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
BIN
topology/icons/greg-ng.png
Normal file
BIN
topology/icons/greg-ng.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
5
topology/icons/proxmox.svg
Normal file
5
topology/icons/proxmox.svg
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="512" cy="512" r="512" style="fill:#e57000"/>
|
||||
<path d="M512 497.8 342.7 311.6c6.6-6.6 14.2-11.7 22.9-15.5 8.7-3.8 18.1-5.7 28.1-5.7 10.7.1 20.4 2.2 29.3 6.3 8.9 4.1 16.6 9.8 23.1 17l65.8 71.9 65.4-71.9c6.8-7.2 14.7-12.9 23.6-17 9-4.1 18.7-6.2 29.2-6.3 10 .1 19.4 2 28.1 5.7 8.7 3.8 16.4 8.9 22.9 15.5L512 497.8m0 28.4L342.7 712.4c6.6 6.6 14.2 11.7 22.9 15.5 8.7 3.8 18.1 5.7 28.1 5.7 10.5-.1 20.2-2.2 29.2-6.3s16.9-9.8 23.6-17l65.4-71.9 65.8 71.9c6.5 7.2 14.2 12.9 23.1 17 8.9 4.1 18.6 6.2 29.3 6.3 10-.1 19.4-2 28.1-5.7 8.7-3.8 16.4-8.9 22.9-15.5L512 526.2M497.8 512 370.3 372.2c-7.4-7.9-16-14.1-25.9-18.7-9.8-4.5-20.5-6.8-31.9-6.9-11 .1-21.3 2.2-30.8 6.3-9.6 4.1-17.9 9.8-25.1 16.9L385.9 512 256.5 654.2c7.2 7.4 15.6 13.2 25.1 17.4 9.6 4.2 19.8 6.3 30.8 6.3 11.5-.1 22.2-2.4 32.1-6.9 9.9-4.5 18.5-10.8 25.7-18.7L497.8 512m28.4 0 127.5 140.3c7.2 7.9 15.8 14.1 25.7 18.7 9.9 4.5 20.6 6.8 32.1 6.9 11-.1 21.3-2.2 30.8-6.3 9.6-4.2 17.9-9.9 25.1-17.4L638.1 512l129.4-142.2c-7.2-7.2-15.6-12.8-25.1-16.9-9.6-4.1-19.8-6.2-30.8-6.3-11.4.1-22.1 2.4-31.9 6.9-9.8 4.5-18.5 10.8-25.9 18.7L526.2 512" style="fill:#fff"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
362
topology/non-nixos-machines.nix
Normal file
362
topology/non-nixos-machines.nix
Normal file
@@ -0,0 +1,362 @@
|
||||
{ config, pkgs, lib, values, ... }:
|
||||
let
|
||||
inherit (config.lib.topology) mkDevice;
|
||||
in {
|
||||
nodes.balduzius = mkDevice "balduzius" {
|
||||
guestType = "proxmox";
|
||||
parent = config.nodes.powerpuff-cluster.id;
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg";
|
||||
|
||||
interfaceGroups = [ [ "ens18" ] ];
|
||||
interfaces.ens18 = {
|
||||
network = "pvv";
|
||||
mac = "00:0c:29:de:05:0f";
|
||||
addresses = [
|
||||
"129.241.210.192"
|
||||
"2001:700:300:1900::1:42"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
|
||||
services = {
|
||||
kdc = {
|
||||
name = "Heimdal KDC";
|
||||
info = "kdc.pvv.ntnu.no";
|
||||
details.kdc.text = "0.0.0.0:88";
|
||||
details.kpasswd.text = "0.0.0.0:464";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nodes.tom = mkDevice "tom" {
|
||||
guestType = "proxmox";
|
||||
parent = config.nodes.powerpuff-cluster.id;
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg";
|
||||
|
||||
interfaceGroups = [ [ "ens18" ] ];
|
||||
interfaces.ens18 = {
|
||||
network = "pvv";
|
||||
mac = "00:0c:29:4d:f7:56";
|
||||
addresses = [
|
||||
"129.241.210.180"
|
||||
"2001:700:300:1900::180"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
|
||||
services = {
|
||||
apache2 = {
|
||||
name = "Apache2 - user websites";
|
||||
info = "www.pvv.ntnu.no/~";
|
||||
details.listen.text = "0.0.0.0:443";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nodes.hildring = mkDevice "hildring" {
|
||||
guestType = "proxmox";
|
||||
parent = config.nodes.powerpuff-cluster.id;
|
||||
deviceType = "loginbox";
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg";
|
||||
|
||||
interfaceGroups = [ [ "eth0" ] ];
|
||||
interfaces.eth0 = {
|
||||
network = "pvv";
|
||||
mac = "00:0c:29:e7:dd:79";
|
||||
addresses = [
|
||||
"129.241.210.176"
|
||||
"2001:700:300:1900::1:9"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.drolsum = mkDevice "drolsum" {
|
||||
guestType = "proxmox";
|
||||
parent = config.nodes.powerpuff-cluster.id;
|
||||
deviceType = "loginbox";
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg";
|
||||
|
||||
# TODO: the interface name is likely wrong
|
||||
interfaceGroups = [ [ "eth0" ] ];
|
||||
interfaces.eth0 = {
|
||||
network = "pvv";
|
||||
# mac = "";
|
||||
addresses = [
|
||||
"129.241.210.217"
|
||||
"2001:700:300:1900::217"
|
||||
"2001:700:300:1900::1:217"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.microbel = mkDevice "microbel" {
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg";
|
||||
|
||||
hardware.info = "Supermicro X8ST3";
|
||||
|
||||
interfaceGroups = [ [ "eth0" "eth1" ] ];
|
||||
interfaces.eth0 = {
|
||||
mac = "00:25:90:24:76:2c";
|
||||
addresses = [
|
||||
"129.241.210.179"
|
||||
"2001:700:300:1900::1:2"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.innovation = mkDevice "innovation" {
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/freebsd.svg";
|
||||
|
||||
hardware.info = "Dell Optiplex 9010";
|
||||
|
||||
interfaceGroups = [ [ "em0" ] ];
|
||||
interfaces.em0 = {
|
||||
mac = "18:03:73:20:18:d3";
|
||||
addresses = [
|
||||
"129.241.210.214"
|
||||
"2001:700:300:1900::1:56"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
services = {
|
||||
minecraft = {
|
||||
name = "Minecraft";
|
||||
icon = "services.minecraft";
|
||||
info = "minecraft.pvv.ntnu.no";
|
||||
details.listen.text = "0.0.0.0:25565";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nodes.principal = mkDevice "principal" {
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/freebsd.svg";
|
||||
|
||||
# TODO: the interface name is likely wrong
|
||||
interfaceGroups = [ [ "em0" ] ];
|
||||
interfaces.em0 = {
|
||||
# mac = "";
|
||||
addresses = [
|
||||
"129.241.210.233"
|
||||
"2001:700:300:1900::1:233"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.homeassistant = mkDevice "homeassistant" {
|
||||
deviceIcon = "services.home-assistant";
|
||||
|
||||
hardware.info = "Raspberry Pi 4B";
|
||||
|
||||
# TODO: the interface name is likely wrong
|
||||
interfaceGroups = [ [ "eth0" ] ];
|
||||
interfaces.eth0 = {
|
||||
# mac = "";
|
||||
addresses = [
|
||||
"129.241.210.229"
|
||||
"2001:700:300:1900::4:229"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.sleipner = mkDevice "sleipner" {
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg";
|
||||
|
||||
interfaceGroups = [ [ "eno0" "enp2s0" ] ];
|
||||
interfaces.enp2s0 = {
|
||||
mac = "00:25:90:57:35:8e";
|
||||
addresses = [
|
||||
"129.241.210.193"
|
||||
"2001:700:300:1900:fab:cab:dab:7ab"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.isvegg = mkDevice "isvegg" {
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg";
|
||||
|
||||
# TODO: the interface name is likely wrong
|
||||
interfaceGroups = [ [ "eth0" ] ];
|
||||
interfaces.eth0 = {
|
||||
# mac = "";
|
||||
addresses = [
|
||||
"129.241.210.175"
|
||||
"2001:700:300:1900::1:a"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.ameno = mkDevice "ameno" {
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/ubuntu.svg";
|
||||
|
||||
interfaceGroups = [ [ "eth0" ] ];
|
||||
interfaces.eth0 = {
|
||||
mac = "b8:27:eb:62:1d:d8";
|
||||
addresses = [
|
||||
"129.241.210.230"
|
||||
"129.241.210.211"
|
||||
"129.241.210.153"
|
||||
"2001:700:300:1900:ba27:ebff:fe62:1dd8"
|
||||
"2001:700:300:1900::4:230"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
services = {
|
||||
bind = {
|
||||
name = "Bind DNS";
|
||||
icon = ./icons/bind9.png;
|
||||
info = "hostmaster.pvv.ntnu.no";
|
||||
details.listen.text = "0.0.0.0:53";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nodes.skrott = mkDevice "skrott" {
|
||||
# TODO: the interface name is likely wrong
|
||||
interfaceGroups = [ [ "eth0" ] ];
|
||||
interfaces.eth0 = {
|
||||
# mac = "";
|
||||
addresses = [
|
||||
"129.241.210.235"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.torskas = mkDevice "torskas" {
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/arch_linux.svg";
|
||||
|
||||
hardware.info = "Raspberry pi 4B";
|
||||
|
||||
# TODO: the interface name is likely wrong
|
||||
interfaceGroups = [ [ "eth0" ] ];
|
||||
interfaces.eth0 = {
|
||||
# mac = "";
|
||||
addresses = [
|
||||
"129.241.210.241"
|
||||
"2001:700:300:1900::241"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.wegonke = mkDevice "wegonke" {
|
||||
deviceType = "terminal";
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg";
|
||||
|
||||
hardware.info = "ASUSTeK G11CD-K";
|
||||
|
||||
interfaceGroups = [ [ "enp4s0" ] ];
|
||||
interfaces.enp4s0 = {
|
||||
mac = "70:4d:7b:a3:32:57";
|
||||
addresses = [
|
||||
"129.241.210.218"
|
||||
"2001:700:300:1900::1:218"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.demiurgen = mkDevice "demiurgen" {
|
||||
deviceType = "terminal";
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg";
|
||||
|
||||
interfaceGroups = [ [ "eno1" ] ];
|
||||
interfaces.eno1 = {
|
||||
mac = "18:03:73:1f:f4:1f";
|
||||
addresses = [
|
||||
"129.241.210.201"
|
||||
"2001:700:300:1900::1:4e"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.sanctuary = mkDevice "sanctuary" {
|
||||
deviceType = "terminal";
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/windows.svg";
|
||||
|
||||
interfaceGroups = [ [ "ethernet_0" ] ];
|
||||
interfaces.ethernet_0 = {
|
||||
addresses = [
|
||||
"129.241.210.170"
|
||||
"2001:700:300:1900::1337"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.orchid = mkDevice "orchid" {
|
||||
deviceType = "terminal";
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg";
|
||||
|
||||
hardware.info = "Ryzen1600 Nvidia GTX 1060";
|
||||
|
||||
# TODO: the interface name is likely wrong
|
||||
interfaceGroups = [ [ "eth0" ] ];
|
||||
interfaces.eth0 = {
|
||||
addresses = [
|
||||
"129.241.210.210"
|
||||
"2001:700:300:1900::210"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
11
topology/service-extractors/greg-ng.nix
Normal file
11
topology/service-extractors/greg-ng.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.services.greg-ng or { enable = false; };
|
||||
in
|
||||
{
|
||||
config.topology.self.services.greg-ng = lib.mkIf cfg.enable {
|
||||
name = "Greg-ng";
|
||||
icon = ../icons/greg-ng.png;
|
||||
details.listen = { text = "${cfg.settings.host}:${toString cfg.settings.port}"; };
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user