Add vault

This commit is contained in:
Charlotte 🦝 Delenk 2022-02-20 20:14:35 +01:00
parent 26b4888cbc
commit 3b61bf31eb
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122
4 changed files with 75 additions and 0 deletions

View file

@ -77,6 +77,7 @@
a6578f9a-288d-44af-8f43-e6402b126bb6 = {
uuid = "a6578f9a-288d-44af-8f43-e6402b126bb6";
name = "DarkKirb";
primary-group = "admin";
parents = [
"admin"
"default"

View file

@ -381,6 +381,7 @@ in
package = luckperms;
startScript = startScript;
}];
services.minecraft.vault.enable = true;
};
}

View file

@ -0,0 +1,19 @@
{ config, lib, options, pkgs, ... }:
with lib;
let
vault = pkgs.callPackage ../../packages/minecraft/vault.nix { };
cfg = config.services.minecraft.vault;
opt = options.services.minecraft.vault;
in
{
options.services.minecraft.vault.enable = mkOption {
default = false;
type = types.bool;
description = "Enable Vault";
};
config = mkIf cfg.enable {
services.minecraft.plugins = [{
package = vault;
}];
};
}

View file

@ -0,0 +1,54 @@
{ fetchFromGitHub
, findutils
, maven
, openjdk8_headless
, stdenv
}:
let
pname = "Vault";
version = "1.7.3";
src = fetchFromGitHub {
owner = "MilkBowl";
repo = "Vault";
rev = version;
sha256 = "05g24xzi7ksncz9rjmwqva2cm7mm88i6qy49a9ad6wa0cgsf660h";
};
deps = stdenv.mkDerivation {
name = "${pname}-deps";
inherit version src;
buildPhase = ''
export JAVA_HOME=${openjdk8_headless}
${maven}/bin/mvn package -Dmaven.repo.local=$out/.m2
'';
installPhase = ''
${findutils}/bin/find $out -type f \
-name \*.lastUpdated -or \
-name resolver-status.properties -or \
-name _remote.repositories \
-delete
'';
dontFixup = true;
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "sha256-Uqwt8+Ra9RTA7lSxRIcbBCC3Duu/NuQku/MsITeNaOk=";
};
in
stdenv.mkDerivation {
inherit pname version src;
name = "${pname}-${version}.jar";
buildPhase = ''
export JAVA_HOME=${openjdk8_headless}
cp -dpR ${deps}/.m2 ./
chmod +w -R .m2
${maven}/bin/mvn package --offline -Dmaven.repo.local=$(pwd)/.m2
'';
installPhase = ''
cp target/${pname}-${version}.jar $out
'';
}