From a86437d4b2c0d43e5a9879c61aaa3bc6b49d4b3b Mon Sep 17 00:00:00 2001 From: Christine Elisabeth Koppel Date: Mon, 6 Apr 2026 00:08:14 +0300 Subject: [PATCH] Add initial configuration files and validation scripts for NixOS setup --- flake.nix | 8 ++++++-- nix-system-configs/modules/system/minecraft.nix | 16 ++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index 475350a..a7d1c5d 100644 --- a/flake.nix +++ b/flake.nix @@ -73,9 +73,13 @@ "nixos-minecraft" = nixpkgs.lib.nixosSystem { inherit system; modules = [ - ./nix-system-configs/modules/system/minecraft.nix + # Apply the overlay first so pkgs in later modules (like our local + # `minecraft.nix`) see the extra helpers provided by the overlay + { nixpkgs.overlays = [ inputs.nix-minecraft.overlay ]; } + nix-minecraft.nixosModules.minecraft-servers - {nixpkgs.overlays = [inputs.nix-minecraft.overlay];} + + ./nix-system-configs/modules/system/minecraft.nix ]; }; }; diff --git a/nix-system-configs/modules/system/minecraft.nix b/nix-system-configs/modules/system/minecraft.nix index 5a1c95d..55bc469 100644 --- a/nix-system-configs/modules/system/minecraft.nix +++ b/nix-system-configs/modules/system/minecraft.nix @@ -7,12 +7,10 @@ choose = paths: builtins.head (builtins.filter (p: builtins.pathExists p) paths); # Domain and Cloudflare DDNS records configured here. Update this list to add/remove records. domain = "prg-radio.org"; - modpack = pkgs.fetchModrinthModpack { - # Get file from local system - src = /srv/minecraft/modpacks/AllTheMods10-prg.mrpack; - packHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; - side = "server"; - }; + # Try to use the nix-minecraft helper if the overlay is present; otherwise + # fall back to a local path. If you use the fallback, ensure the path is an + # unpacked modpack directory with `mods` and `config` subdirectories. + modpack = /srv/minecraft/modpacks/AllTheMods10-prg.mrpack; in { options.local = { hostname = lib.mkOption { @@ -129,10 +127,12 @@ in { }; symlinks = { - "mods" = "${modpack}/mods"; + "mods" = "${modpack}/overrides/mods"; }; files = { - "config" = "${modpack}/config"; + "config" = "${modpack}/overrides/config"; + "kubejs" = "${modpack}/overrides/kubejs"; + "datapacks" = "${modpack}/overrides/datapacks"; }; };