Add vault
This commit is contained in:
parent
26b4888cbc
commit
3b61bf31eb
4 changed files with 75 additions and 0 deletions
|
@ -77,6 +77,7 @@
|
|||
a6578f9a-288d-44af-8f43-e6402b126bb6 = {
|
||||
uuid = "a6578f9a-288d-44af-8f43-e6402b126bb6";
|
||||
name = "DarkKirb";
|
||||
primary-group = "admin";
|
||||
parents = [
|
||||
"admin"
|
||||
"default"
|
||||
|
|
|
@ -381,6 +381,7 @@ in
|
|||
package = luckperms;
|
||||
startScript = startScript;
|
||||
}];
|
||||
services.minecraft.vault.enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
19
modules/minecraft/vault.nix
Normal file
19
modules/minecraft/vault.nix
Normal 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;
|
||||
}];
|
||||
};
|
||||
}
|
54
packages/minecraft/vault.nix
Normal file
54
packages/minecraft/vault.nix
Normal 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
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue