System Gen143 @ 2026-03-19-20:01:56 by jonas@monolith

This commit is contained in:
2026-03-27 00:46:09 +01:00
parent 387cf61bfa
commit 8d7af1285b
5 changed files with 146 additions and 3 deletions

56
flake.lock generated
View File

@@ -158,6 +158,22 @@
} }
}, },
"flake-compat_2": { "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, "flake": false,
"locked": { "locked": {
"lastModified": 1746162366, "lastModified": 1746162366,
@@ -635,12 +651,34 @@
"type": "github" "type": "github"
} }
}, },
"nixos-cosmic": { "nix-minecraft": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
"nixpkgs": [ "nixpkgs": [
"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", "nixpkgs-stable": "nixpkgs-stable",
"rust-overlay": "rust-overlay_2" "rust-overlay": "rust-overlay_2"
}, },
@@ -777,6 +815,7 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprland": "hyprland", "hyprland": "hyprland",
"hyprland-plugins": "hyprland-plugins", "hyprland-plugins": "hyprland-plugins",
"nix-minecraft": "nix-minecraft",
"nixos-cosmic": "nixos-cosmic", "nixos-cosmic": "nixos-cosmic",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
@@ -880,6 +919,21 @@
"type": "github" "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": { "xdph": {
"inputs": { "inputs": {
"hyprland-protocols": [ "hyprland-protocols": [

View File

@@ -44,13 +44,14 @@
url = "github:polygon/audio.nix"; url = "github:polygon/audio.nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nix-minecraft.url = "github:Infinidoge/nix-minecraft";
nix-minecraft.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = { outputs = {
self, self,
nixpkgs, nixpkgs,
nixpkgs-unstable, nixpkgs-unstable,
disko,
nixos-hardware, nixos-hardware,
home-manager, home-manager,
nixos-cosmic, nixos-cosmic,
@@ -77,6 +78,8 @@
({...}: {nixpkgs.config.allowUnfree = true;}) ({...}: {nixpkgs.config.allowUnfree = true;})
nixos-hardware.nixosModules.msi-b550-a-pro nixos-hardware.nixosModules.msi-b550-a-pro
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
inputs.nix-minecraft.overlay
inputs.nix-minecraft.nixosModules.minecraft-servers
./modules ./modules
./hosts/comfy-station/configuration.nix ./hosts/comfy-station/configuration.nix
]; ];
@@ -93,6 +96,7 @@
overlay-unstable overlay-unstable
self.overlays.default self.overlays.default
audio.overlays.default audio.overlays.default
inputs.nix-minecraft.overlay
]; ];
}) })
({...}: { ({...}: {
@@ -108,6 +112,7 @@
nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1 nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
nixos-cosmic.nixosModules.default nixos-cosmic.nixosModules.default
inputs.nix-minecraft.nixosModules.minecraft-servers
./fixes/plasma-fix.nix ./fixes/plasma-fix.nix
./modules ./modules
./hosts/monolith/configuration.nix ./hosts/monolith/configuration.nix
@@ -120,10 +125,18 @@
isHM = false; isHM = false;
}; };
modules = [ 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;}) ({...}: {nixpkgs.config.allowUnfree = true;})
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
inputs.nix-minecraft.nixosModules.minecraft-servers
./modules ./modules
./hosts/harbor/configuration.nix ./hosts/harbor/configuration.nix
]; ];

View File

@@ -31,6 +31,7 @@
./services/gitea-instance.nix ./services/gitea-instance.nix
./services/gotify-instance.nix ./services/gotify-instance.nix
./services/kdeconnect.nix ./services/kdeconnect.nix
./services/minecraft-server
./services/nextcloud-instance.nix ./services/nextcloud-instance.nix
./services/virt-manager.nix ./services/virt-manager.nix
] ]

View 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;
};
});
};
}

View 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";
}