Compare commits

...

10 Commits

Author SHA1 Message Date
h7x4
7f8c306d9a bekkalokk/gitea: add navbar item 'Howto' 2025-03-09 11:34:50 +01:00
Daniel Olsen
94d73b34ad bluemap: generate web folder if it doesnt exist before rendering 2025-03-02 02:32:32 +01:00
Daniel Olsen
bf50d6478b bluemap: 5.4 -> 5.7 2025-03-02 01:27:09 +01:00
h7x4
e9dc0d85a0 flake.lock: bump 2025-03-01 21:31:56 +01:00
Daniel Olsen
a009b05977 bicep/matrix/coturn: coturn is actually fixed 2025-02-16 02:01:29 +01:00
Øystein Tveit
8a8f5659fb gergle: big if true 2025-01-25 19:59:43 +01:00
13c921c47b bekkalokk: Update nettsiden (re-enable events) 2025-01-17 23:11:19 +01:00
h7x4
819fcef4c2 flake.lock: bump greg-ng 2025-01-11 15:02:00 +01:00
h7x4
102a6f9011 flake.lock: bump nix-gitea-themes 2025-01-10 18:51:41 +01:00
h7x4
86e68f496e bekkalokk/gitea: add declarative label set 'projects' 2025-01-10 18:51:40 +01:00
9 changed files with 295 additions and 61 deletions

77
flake.lock generated
View File

@@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733168902, "lastModified": 1740485968,
"narHash": "sha256-8dupm9GfK+BowGdQd7EHK5V61nneLfr9xR6sc5vtDi0=", "narHash": "sha256-WK+PZHbfDjLyveXAxpnrfagiFgZWaTJglewBWniTn2Y=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "785c1e02c7e465375df971949b8dcbde9ec362e5", "rev": "19c1140419c4f1cdf88ad4c1cfb6605597628940",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -20,6 +20,26 @@
"type": "github" "type": "github"
} }
}, },
"gergle": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1736621371,
"narHash": "sha256-45UIQSQA7R5iU4YWvilo7mQbhY1Liql9bHBvYa3qRI0=",
"ref": "refs/heads/main",
"rev": "3729796c1213fe76e568ac28f1df8de4e596950b",
"revCount": 20,
"type": "git",
"url": "https://git.pvv.ntnu.no/Grzegorz/gergle.git"
},
"original": {
"type": "git",
"url": "https://git.pvv.ntnu.no/Grzegorz/gergle.git"
}
},
"greg-ng": { "greg-ng": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -28,11 +48,11 @@
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1736177549, "lastModified": 1736545379,
"narHash": "sha256-iEgxxU4INJXntv20A5WQQ/9P0ulDxGaZ8Cn8sfvyAFU=", "narHash": "sha256-PeTTmGumdOX3rd6OKI7QMCrZovCDkrckZbcHr+znxWA=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "29ae3d7482420f1757cca5558d16420aaac22f61", "rev": "74f5316121776db2769385927ec0d0c2cc2b23e4",
"revCount": 39, "revCount": 42,
"type": "git", "type": "git",
"url": "https://git.pvv.ntnu.no/Grzegorz/greg-ng.git" "url": "https://git.pvv.ntnu.no/Grzegorz/greg-ng.git"
}, },
@@ -48,11 +68,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1726861934, "lastModified": 1736178795,
"narHash": "sha256-lOzPDwktd+pwszUTbpUdQg6iCzInS11fHLfkjmnvJrM=", "narHash": "sha256-mPdi8cgvIDYcgG3FRG7A4BOIMu2Jef96TPMnV00uXlM=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "546d921ec46735dbf876e36f4af8df1064d09432", "rev": "fde738910de1fd8293535a6382c2f0c2749dd7c1",
"revCount": 78, "revCount": 79,
"type": "git", "type": "git",
"url": "https://git.pvv.ntnu.no/Grzegorz/grzegorz-clients.git" "url": "https://git.pvv.ntnu.no/Grzegorz/grzegorz-clients.git"
}, },
@@ -104,11 +124,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1714416973, "lastModified": 1736531400,
"narHash": "sha256-aZUcvXjdETUC6wVQpWDVjLUzwpDAEca8yR0ITDeK39o=", "narHash": "sha256-+X/HVI1AwoPcud28wI35XRrc1kDgkYdDUGABJBAkxDI=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "2b23c0ba8aae68d3cb6789f0f6e4891cef26cc6d", "rev": "e4dafd06b3d7e9e6e07617766e9c3743134571b7",
"revCount": 6, "revCount": 7,
"type": "git", "type": "git",
"url": "https://git.pvv.ntnu.no/oysteikt/nix-gitea-themes.git" "url": "https://git.pvv.ntnu.no/oysteikt/nix-gitea-themes.git"
}, },
@@ -119,11 +139,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1733466147, "lastModified": 1740782485,
"narHash": "sha256-1QAch5UZXGDc8Kh3PvdIKfVNeebjZFWiIKn8lAr1ZBM=", "narHash": "sha256-GkDJDqHYlPKZFdyxzZHtljxNRsosKB1GCrblqlvLFgo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "66dddf2c2aae34272f117ea95a06efe376edbe27", "rev": "dd5c2540983641bbaabdfc665931592d4c9989e8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -135,11 +155,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1733603762, "lastModified": 1740848276,
"narHash": "sha256-E+cuaL8s1oHCumWD/Zkw0gkLOOQcz848pVyLfvqWDVw=", "narHash": "sha256-bYeI3FEs824X+MJYksKboNlmglehzplqzn+XvcojWMc=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b1dd465e8139748a8e26037fdd4c5ffe79457cbd", "rev": "e9b0ff70ddc61c42548501b0fafb86bb49cca858",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -176,11 +196,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1734820349, "lastModified": 1737151758,
"narHash": "sha256-ZjfttVIMtDqns9wNRyWfP7Ae+kuEZfyXK5sqLmxzsgU=", "narHash": "sha256-yZBsefIarFUEhFRj+rCGMp9Zvag3MCafqV/JfGVRVwc=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "2930f9863ffa4bdc036535159717c9605bcb5a06", "rev": "a4ebe6ded0c8c124561a41cb329ff30891914b5e",
"revCount": 474, "revCount": 475,
"type": "git", "type": "git",
"url": "https://git.pvv.ntnu.no/Projects/nettsiden.git" "url": "https://git.pvv.ntnu.no/Projects/nettsiden.git"
}, },
@@ -192,6 +212,7 @@
"root": { "root": {
"inputs": { "inputs": {
"disko": "disko", "disko": "disko",
"gergle": "gergle",
"greg-ng": "greg-ng", "greg-ng": "greg-ng",
"grzegorz-clients": "grzegorz-clients", "grzegorz-clients": "grzegorz-clients",
"matrix-next": "matrix-next", "matrix-next": "matrix-next",
@@ -232,11 +253,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733128155, "lastModified": 1739262228,
"narHash": "sha256-m6/qwJAJYcidGMEdLqjKzRIjapK4nUfMq7rDCTmZajc=", "narHash": "sha256-7JAGezJ0Dn5qIyA2+T4Dt/xQgAbhCglh6lzCekTVMeU=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "c6134b6fff6bda95a1ac872a2a9d5f32e3c37856", "rev": "07af005bb7d60c7f118d9d9f5530485da5d1e975",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -25,6 +25,8 @@
greg-ng.url = "git+https://git.pvv.ntnu.no/Grzegorz/greg-ng.git"; greg-ng.url = "git+https://git.pvv.ntnu.no/Grzegorz/greg-ng.git";
greg-ng.inputs.nixpkgs.follows = "nixpkgs"; greg-ng.inputs.nixpkgs.follows = "nixpkgs";
gergle.url = "git+https://git.pvv.ntnu.no/Grzegorz/gergle.git";
gergle.inputs.nixpkgs.follows = "nixpkgs";
grzegorz-clients.url = "git+https://git.pvv.ntnu.no/Grzegorz/grzegorz-clients.git"; grzegorz-clients.url = "git+https://git.pvv.ntnu.no/Grzegorz/grzegorz-clients.git";
grzegorz-clients.inputs.nixpkgs.follows = "nixpkgs"; grzegorz-clients.inputs.nixpkgs.follows = "nixpkgs";
@@ -124,19 +126,23 @@
brzeczyszczykiewicz = stableNixosConfig "brzeczyszczykiewicz" { brzeczyszczykiewicz = stableNixosConfig "brzeczyszczykiewicz" {
modules = [ modules = [
inputs.grzegorz-clients.nixosModules.grzegorz-webui inputs.grzegorz-clients.nixosModules.grzegorz-webui
inputs.gergle.nixosModules.default
inputs.greg-ng.nixosModules.default inputs.greg-ng.nixosModules.default
]; ];
overlays = [ overlays = [
inputs.greg-ng.overlays.default inputs.greg-ng.overlays.default
inputs.gergle.overlays.default
]; ];
}; };
georg = stableNixosConfig "georg" { georg = stableNixosConfig "georg" {
modules = [ modules = [
inputs.grzegorz-clients.nixosModules.grzegorz-webui inputs.grzegorz-clients.nixosModules.grzegorz-webui
inputs.gergle.nixosModules.default
inputs.greg-ng.nixosModules.default inputs.greg-ng.nixosModules.default
]; ];
overlays = [ overlays = [
inputs.greg-ng.overlays.default inputs.greg-ng.overlays.default
inputs.gergle.overlays.default
]; ];
}; };
}; };

View File

@@ -13,6 +13,8 @@ in {
services.bluemap = { services.bluemap = {
enable = true; enable = true;
package = pkgs.callPackage ./package.nix { };
eula = true; eula = true;
onCalendar = "*-*-* 05:45:00"; # a little over an hour after auto-upgrade onCalendar = "*-*-* 05:45:00"; # a little over an hour after auto-upgrade

View File

@@ -26,7 +26,6 @@ let
"webapp.conf" = webappConfig; "webapp.conf" = webappConfig;
"webserver.conf" = webserverConfig; "webserver.conf" = webserverConfig;
"packs" = cfg.resourcepacks; "packs" = cfg.resourcepacks;
"addons" = cfg.resourcepacks; # TODO
}; };
renderConfigFolder = name: value: pkgs.linkFarm "bluemap-${name}-config" { renderConfigFolder = name: value: pkgs.linkFarm "bluemap-${name}-config" {
@@ -38,13 +37,13 @@ let
"webapp.conf" = format.generate "webapp.conf" (cfg.webappSettings // { "update-settings-file" = false; }); "webapp.conf" = format.generate "webapp.conf" (cfg.webappSettings // { "update-settings-file" = false; });
"webserver.conf" = webserverConfig; "webserver.conf" = webserverConfig;
"packs" = value.resourcepacks; "packs" = value.resourcepacks;
"addons" = cfg.resourcepacks; # TODO
}; };
inherit (lib) mkOption; inherit (lib) mkOption;
in { in {
options.services.bluemap = { options.services.bluemap = {
enable = lib.mkEnableOption "bluemap"; enable = lib.mkEnableOption "bluemap";
package = lib.mkPackageOption pkgs "bluemap" { };
eula = mkOption { eula = mkOption {
type = lib.types.bool; type = lib.types.bool;
@@ -159,7 +158,7 @@ in {
type = lib.types.path; type = lib.types.path;
default = cfg.resourcepacks; default = cfg.resourcepacks;
defaultText = lib.literalExpression "config.services.bluemap.resourcepacks"; defaultText = lib.literalExpression "config.services.bluemap.resourcepacks";
description = "A set of resourcepacks/mods to extract models from loaded in alphabetical order"; description = "A set of resourcepacks/mods/bluemap-addons to extract models from loaded in alphabetical order";
}; };
settings = mkOption { settings = mkOption {
type = (lib.types.submodule { type = (lib.types.submodule {
@@ -310,9 +309,18 @@ in {
Group = "nginx"; Group = "nginx";
UMask = "026"; UMask = "026";
}; };
script = lib.strings.concatStringsSep "\n" ((lib.attrsets.mapAttrsToList script = ''
(name: value: "${lib.getExe pkgs.bluemap} -c ${renderConfigFolder name value} -r") # If web folder doesnt exist generate it
cfg.maps) ++ [ "${lib.getExe pkgs.bluemap} -c ${webappConfigFolder} -gs" ]); test -f "${cfg.webRoot}" || ${lib.getExe cfg.package} -c ${webappConfigFolder} -gs
# Render each minecraft map
${lib.strings.concatStringsSep "\n" (lib.attrsets.mapAttrsToList
(name: value: "${lib.getExe cfg.package} -c ${renderConfigFolder name value} -r")
cfg.maps)}
# Generate updated webapp
${lib.getExe cfg.package} -c ${webappConfigFolder} -gs
'';
}; };
systemd.timers."render-bluemap-maps" = lib.mkIf cfg.enableRender { systemd.timers."render-bluemap-maps" = lib.mkIf cfg.enableRender {

View File

@@ -0,0 +1,30 @@
{ lib, stdenvNoCC, fetchurl, makeWrapper, jre }:
stdenvNoCC.mkDerivation rec {
pname = "bluemap";
version = "5.7";
src = fetchurl {
url = "https://github.com/BlueMap-Minecraft/BlueMap/releases/download/v${version}/BlueMap-${version}-cli.jar";
hash = "sha256-8udZYJgrr4bi2mjRYrASd8JwUoUVZW1tZpOLRgafAIw=";
};
dontUnpack = true;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
makeWrapper ${jre}/bin/java $out/bin/bluemap --add-flags "-jar $src"
runHook postInstall
'';
meta = {
description = "3D minecraft map renderer";
homepage = "https://bluemap.bluecolored.de/";
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ dandellion h7x4 ];
mainProgram = "bluemap";
};
}

View File

@@ -179,12 +179,18 @@ in {
<a class="item" href="https://www.pvv.ntnu.no/">PVV</a> <a class="item" href="https://www.pvv.ntnu.no/">PVV</a>
<a class="item" href="https://wiki.pvv.ntnu.no/">Wiki</a> <a class="item" href="https://wiki.pvv.ntnu.no/">Wiki</a>
<a class="item" href="https://git.pvv.ntnu.no/Drift/-/projects/4">Tokyo Drift Issues</a> <a class="item" href="https://git.pvv.ntnu.no/Drift/-/projects/4">Tokyo Drift Issues</a>
<a class="item" href="https://wiki.pvv.ntnu.no/wiki/Tjenester/Kodelager">Howto</a>
''; '';
project-labels = (pkgs.formats.yaml { }).generate "gitea-project-labels.yaml" {
labels = lib.importJSON ./labels/projects.json;
};
in '' in ''
install -Dm444 ${logo-svg} ${cfg.customDir}/public/assets/img/logo.svg install -Dm444 ${logo-svg} ${cfg.customDir}/public/assets/img/logo.svg
install -Dm444 ${logo-png} ${cfg.customDir}/public/assets/img/logo.png install -Dm444 ${logo-png} ${cfg.customDir}/public/assets/img/logo.png
install -Dm444 ${./loading.apng} ${cfg.customDir}/public/assets/img/loading.png install -Dm444 ${./loading.apng} ${cfg.customDir}/public/assets/img/loading.png
install -Dm444 ${extraLinks} ${cfg.customDir}/templates/custom/extra_links.tmpl install -Dm444 ${extraLinks} ${cfg.customDir}/templates/custom/extra_links.tmpl
install -Dm444 ${project-labels} ${cfg.customDir}/options/label/project-labels.yaml
''; '';
}; };
} }

View File

@@ -0,0 +1,116 @@
[
{
"name": "art",
"exclusive": false,
"color": "#006b75",
"description": "Requires some creativity"
},
{
"name": "big",
"exclusive": false,
"color": "#754bc4",
"description": "This is gonna take a while"
},
{
"name": "blocked",
"exclusive": false,
"color": "#850021",
"description": "This issue/PR depends on one or more other issues/PRs"
},
{
"name": "bug",
"exclusive": false,
"color": "#f05048",
"description": "Something brokey"
},
{
"name": "ci-cd",
"exclusive": false,
"color": "#d1ff78",
"description": "Continuous integrals and continuous derivation"
},
{
"name": "crash report",
"exclusive": false,
"color": "#ed1111",
"description": "Report an oopsie"
},
{
"name": "disputed",
"exclusive": false,
"color": "#5319e7",
"description": "Kranglefanter"
},
{
"name": "documentation",
"exclusive": false,
"color": "#fbca04",
"description": "Documentation changes required"
},
{
"name": "duplicate",
"exclusive": false,
"color": "#cccccc",
"description": "This issue or pull request already exists"
},
{
"name": "feature request",
"exclusive": false,
"color": "#0052cc",
"description": ""
},
{
"name": "good first issue",
"exclusive": false,
"color": "#009800",
"description": "Get your hands dirty with a new project here"
},
{
"name": "me gusta",
"exclusive": false,
"color": "#30ff36",
"description": "( ͡° ͜ʖ ͡°)"
},
{
"name": "packaging",
"exclusive": false,
"color": "#bf642b",
"description": ""
},
{
"name": "question",
"exclusive": false,
"color": "#cc317c",
"description": ""
},
{
"name": "security",
"exclusive": false,
"color": "#ed1111",
"description": "Skommel"
},
{
"name": "techdebt spring cleaning",
"exclusive": false,
"color": "#8c6217",
"description": "The code is smelly 👃"
},
{
"name": "testing",
"exclusive": false,
"color": "#52b373",
"description": "Poke it and see if it explodes"
},
{
"name": "ui/ux",
"exclusive": false,
"color": "#f28852",
"description": "User complaints about ergonomics and economics and whatever"
},
{
"name": "wontfix",
"exclusive": false,
"color": "#ffffff",
"description": "Nei, vil ikke"
}
]

View File

@@ -48,6 +48,9 @@
users.users.turnserver.extraGroups = [ "acme" ]; users.users.turnserver.extraGroups = [ "acme" ];
# It needs this to be allowed to access the files with the acme group
systemd.services.coturn.serviceConfig.PrivateUsers = lib.mkForce false;
systemd.services."acme-${config.services.coturn.realm}".serviceConfig = { systemd.services."acme-${config.services.coturn.realm}".serviceConfig = {
AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ]; AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ];
}; };
@@ -66,7 +69,7 @@
listening-ips = [ listening-ips = [
values.services.turn.ipv4 values.services.turn.ipv4
# values.services.turn.ipv6 values.services.turn.ipv6
]; ];
tls-listening-port = 443; tls-listening-port = 443;

View File

@@ -2,6 +2,8 @@
let let
grg = config.services.greg-ng; grg = config.services.greg-ng;
grgw = config.services.grzegorz-webui; grgw = config.services.grzegorz-webui;
machine = config.networking.hostName;
in { in {
services.greg-ng = { services.greg-ng = {
enable = true; enable = true;
@@ -16,37 +18,77 @@ in {
listenAddr = "localhost"; listenAddr = "localhost";
listenPort = 42069; listenPort = 42069;
listenWebsocketPort = 42042; listenWebsocketPort = 42042;
hostName = "${config.networking.fqdn}"; hostName = "${machine}-old.pvv.ntnu.no";
apiBase = "http://${grg.settings.host}:${toString grg.settings.port}/api"; apiBase = "https://${machine}-backend.pvv.ntnu.no/api";
};
services.gergle = {
enable = true;
virtualHost = config.networking.fqdn;
}; };
services.nginx.enable = true; services.nginx.enable = true;
services.nginx.virtualHosts."${config.networking.fqdn}" = { services.nginx.virtualHosts = {
forceSSL = true; ${config.networking.fqdn} = {
enableACME = true; forceSSL = true;
kTLS = true; enableACME = true;
serverAliases = [ kTLS = true;
"${config.networking.hostName}.pvv.org" serverAliases = [
]; "${machine}.pvv.org"
extraConfig = '' ];
allow 129.241.210.128/25; extraConfig = ''
allow 2001:700:300:1900::/64; allow 129.241.210.128/25;
deny all; allow 2001:700:300:1900::/64;
''; deny all;
'';
};
locations."/" = { "${machine}-backend.pvv.ntnu.no" = {
proxyPass = "http://${grgw.listenAddr}:${toString grgw.listenPort}"; forceSSL = true;
enableACME = true;
kTLS = true;
serverAliases = [
"${machine}-backend.pvv.org"
];
extraConfig = ''
allow 129.241.210.128/25;
allow 2001:700:300:1900::/64;
deny all;
'';
locations."/" = {
proxyPass = "http://${grg.settings.host}:${toString grg.settings.port}";
proxyWebsockets = true;
};
}; };
# https://github.com/rawpython/remi/issues/216
locations."/websocket" = { "${machine}-old.pvv.ntnu.no" = {
proxyPass = "http://${grgw.listenAddr}:${toString grgw.listenWebsocketPort}"; forceSSL = true;
proxyWebsockets = true; enableACME = true;
}; kTLS = true;
locations."/api" = { serverAliases = [
proxyPass = "http://${grg.settings.host}:${toString grg.settings.port}"; "${machine}-old.pvv.org"
}; ];
locations."/docs" = { extraConfig = ''
proxyPass = "http://${grg.settings.host}:${toString grg.settings.port}"; allow 129.241.210.128/25;
allow 2001:700:300:1900::/64;
deny all;
'';
locations."/" = {
proxyPass = "http://${grgw.listenAddr}:${toString grgw.listenPort}";
};
# https://github.com/rawpython/remi/issues/216
locations."/websocket" = {
proxyPass = "http://${grgw.listenAddr}:${toString grgw.listenWebsocketPort}";
proxyWebsockets = true;
};
locations."/api" = {
proxyPass = "http://${grg.settings.host}:${toString grg.settings.port}";
};
locations."/docs" = {
proxyPass = "http://${grg.settings.host}:${toString grg.settings.port}";
};
}; };
}; };
} }