System Gen143 @ 2026-03-19-20:01:56 by jonas@monolith
This commit is contained in:
56
flake.lock
generated
56
flake.lock
generated
@@ -158,6 +158,22 @@
|
||||
}
|
||||
},
|
||||
"flake-compat_2": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1747046372,
|
||||
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat_3": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1746162366,
|
||||
@@ -635,12 +651,34 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-cosmic": {
|
||||
"nix-minecraft": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_2",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1774407052,
|
||||
"narHash": "sha256-rUkn7Bo3PAlpcZl8+0FDsTwFyDwvS4xwMT9+RJ+XJoE=",
|
||||
"owner": "Infinidoge",
|
||||
"repo": "nix-minecraft",
|
||||
"rev": "70daf1f48885f0b4a70797076cd2ff5d9139b46e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Infinidoge",
|
||||
"repo": "nix-minecraft",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-cosmic": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_3",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"nixpkgs-stable": "nixpkgs-stable",
|
||||
"rust-overlay": "rust-overlay_2"
|
||||
},
|
||||
@@ -777,6 +815,7 @@
|
||||
"home-manager": "home-manager",
|
||||
"hyprland": "hyprland",
|
||||
"hyprland-plugins": "hyprland-plugins",
|
||||
"nix-minecraft": "nix-minecraft",
|
||||
"nixos-cosmic": "nixos-cosmic",
|
||||
"nixos-hardware": "nixos-hardware",
|
||||
"nixpkgs": "nixpkgs",
|
||||
@@ -880,6 +919,21 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"xdph": {
|
||||
"inputs": {
|
||||
"hyprland-protocols": [
|
||||
|
||||
17
flake.nix
17
flake.nix
@@ -44,13 +44,14 @@
|
||||
url = "github:polygon/audio.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
nix-minecraft.url = "github:Infinidoge/nix-minecraft";
|
||||
nix-minecraft.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
nixpkgs-unstable,
|
||||
disko,
|
||||
nixos-hardware,
|
||||
home-manager,
|
||||
nixos-cosmic,
|
||||
@@ -77,6 +78,8 @@
|
||||
({...}: {nixpkgs.config.allowUnfree = true;})
|
||||
nixos-hardware.nixosModules.msi-b550-a-pro
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
inputs.nix-minecraft.overlay
|
||||
inputs.nix-minecraft.nixosModules.minecraft-servers
|
||||
./modules
|
||||
./hosts/comfy-station/configuration.nix
|
||||
];
|
||||
@@ -93,6 +96,7 @@
|
||||
overlay-unstable
|
||||
self.overlays.default
|
||||
audio.overlays.default
|
||||
inputs.nix-minecraft.overlay
|
||||
];
|
||||
})
|
||||
({...}: {
|
||||
@@ -108,6 +112,7 @@
|
||||
nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
nixos-cosmic.nixosModules.default
|
||||
inputs.nix-minecraft.nixosModules.minecraft-servers
|
||||
./fixes/plasma-fix.nix
|
||||
./modules
|
||||
./hosts/monolith/configuration.nix
|
||||
@@ -120,10 +125,18 @@
|
||||
isHM = false;
|
||||
};
|
||||
modules = [
|
||||
({...}: {nixpkgs.overlays = [overlay-unstable self.overlays.default audio.overlays.default];})
|
||||
({...}: {
|
||||
nixpkgs.overlays = [
|
||||
overlay-unstable
|
||||
self.overlays.default
|
||||
audio.overlays.default
|
||||
inputs.nix-minecraft.overlay
|
||||
];
|
||||
})
|
||||
({...}: {nixpkgs.config.allowUnfree = true;})
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
inputs.disko.nixosModules.disko
|
||||
inputs.nix-minecraft.nixosModules.minecraft-servers
|
||||
./modules
|
||||
./hosts/harbor/configuration.nix
|
||||
];
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
./services/gitea-instance.nix
|
||||
./services/gotify-instance.nix
|
||||
./services/kdeconnect.nix
|
||||
./services/minecraft-server
|
||||
./services/nextcloud-instance.nix
|
||||
./services/virt-manager.nix
|
||||
]
|
||||
|
||||
39
modules/services/minecraft-server/default.nix
Normal file
39
modules/services/minecraft-server/default.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hive.services.minecraft-server;
|
||||
|
||||
modpack = pkgs.callPackage ./loadCurseForge.nix {
|
||||
url = "https://mediafilez.forgecdn.net/files/7765/203/BMC3_Server_Pack_v44.zip";
|
||||
hash = "";
|
||||
};
|
||||
|
||||
mcVersion = modpack.variables.MINECRAFT_VERSION;
|
||||
loader = lib.toLower modpack.variables.MODLOADER;
|
||||
loaderVersion = modpack.variables.MODLOADER_VERSION;
|
||||
serverVersion = lib.replaceStrings ["."] ["_"] "${loader}-${mcVersion}";
|
||||
in {
|
||||
options.hive.services.minecraft-server = {
|
||||
enable = lib.mkEnableOption "Enable BMC3 server";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.minecraft-servers.servers.bmc3 =
|
||||
{
|
||||
enable = true;
|
||||
eula = true;
|
||||
}
|
||||
# Prevent download of modpack if not enabled
|
||||
// (lib.optionalAttrs cfg.enable {
|
||||
package = pkgs."${loader}Servers".${serverVersion}.override {inherit loaderVersion;};
|
||||
jvmOpts = modpack.variables.JAVA_ARGS;
|
||||
symlinks = {
|
||||
"mods" = modpack.mods;
|
||||
"config" = modpack.config;
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
36
modules/services/minecraft-server/loadCurseForge.nix
Normal file
36
modules/services/minecraft-server/loadCurseForge.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
url ? null,
|
||||
hash ? null,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
modpack = pkgs.fetchzip {
|
||||
inherit url hash;
|
||||
stripRoot = false;
|
||||
};
|
||||
|
||||
variablesStr = builtins.readFile "${modpack}/variables.txt";
|
||||
variableLines =
|
||||
builtins.filter (l: l != "" && (lib.strings.elemAt (lib.stringToCharacters l) 0) != "#")
|
||||
(lib.strings.splitString "\n" variablesStr);
|
||||
|
||||
stripQuotes = s:
|
||||
if builtins.match "^\".*\"$" s != null
|
||||
then builtins.substring 1 (builtins.stringLength s - 2) s
|
||||
else s;
|
||||
|
||||
parseLine = line: let
|
||||
parts = lib.strings.splitString "=" line;
|
||||
in {
|
||||
name = builtins.elemAt parts 0;
|
||||
value = stripQuotes (builtins.concatStringsSep "=" (builtins.tail parts));
|
||||
};
|
||||
|
||||
variables = builtins.listToAttrs (map parseLine variableLines);
|
||||
in {
|
||||
inherit variables;
|
||||
root = modpack;
|
||||
mods = "${modpack}/mods";
|
||||
config = "${modpack}/config";
|
||||
}
|
||||
Reference in New Issue
Block a user