mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2025-04-03 12:51:23 +02:00
Compare commits
3 Commits
a009b05977
...
94d73b34ad
Author | SHA1 | Date | |
---|---|---|---|
![]() |
94d73b34ad | ||
![]() |
bf50d6478b | ||
![]() |
e9dc0d85a0 |
32
flake.lock
generated
32
flake.lock
generated
@ -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": {
|
||||||
@ -68,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"
|
||||||
},
|
},
|
||||||
@ -139,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": {
|
||||||
@ -155,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": {
|
||||||
@ -253,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": {
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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 {
|
||||||
|
30
hosts/bekkalokk/services/bluemap/package.nix
Normal file
30
hosts/bekkalokk/services/bluemap/package.nix
Normal 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";
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user