From e4be2c87c3343476e382d7b7dd6aab23a12dfd9e Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Sat, 11 May 2024 20:11:37 +0200 Subject: [PATCH] add minecraft server --- flake.lock | 72 +++++++++++++++++++++++++++++++++ flake.nix | 5 +++ hosts/default/configuration.nix | 16 +++++++- 3 files changed, 91 insertions(+), 2 deletions(-) diff --git a/flake.lock b/flake.lock index dd05d59..3fbc396 100644 --- a/flake.lock +++ b/flake.lock @@ -94,6 +94,22 @@ "type": "github" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -152,6 +168,24 @@ "type": "github" } }, + "flake-utils_3": { + "inputs": { + "systems": "systems_4" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -454,6 +488,28 @@ "type": "github" } }, + "nix-minecraft": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_3", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1715403153, + "narHash": "sha256-9s1TLgTG54WxEz2AnT/N5V7zEF9rRVsZT5I9AQnroAE=", + "owner": "Infinidoge", + "repo": "nix-minecraft", + "rev": "d9ca459b3b87d2639407cef26bb8e94a1314f40e", + "type": "github" + }, + "original": { + "owner": "Infinidoge", + "repo": "nix-minecraft", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1711297276, @@ -576,6 +632,7 @@ "hyprpicker": "hyprpicker", "lazy": "lazy", "nix-colors": "nix-colors", + "nix-minecraft": "nix-minecraft", "nixpkgs": "nixpkgs_3" } }, @@ -651,6 +708,21 @@ "type": "github" } }, + "systems_4": { + "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": "hyprland-protocols", diff --git a/flake.nix b/flake.nix index e9746e7..22aa857 100644 --- a/flake.nix +++ b/flake.nix @@ -20,6 +20,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + nix-minecraft = { + url = "github:Infinidoge/nix-minecraft"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + hyprland = { url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix index fd23a9f..240dd2a 100644 --- a/hosts/default/configuration.nix +++ b/hosts/default/configuration.nix @@ -3,13 +3,13 @@ # and in the NixOS manual (accessible by running ‘nixos-help’). { config, pkgs, inputs, nix-colors, ... }: - -rec { +{ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix inputs.home-manager.nixosModules.default ../../modules/games/steam.nix + inputs.nix-minecraft.nixosModules.minecraft-servers ]; # Bootloader. @@ -41,6 +41,7 @@ rec { allowUnfree = true; nvidia.acceptLicense = true; }; + nixpkgs.overlays = [ inputs.nix-minecraft.overlay ]; networking = { hostName = "lambdaOS"; # Define your hostname. @@ -209,6 +210,17 @@ rec { default_session = initial_session; }; }; + minecraft-servers = { + enable = true; + eula = true; + openFirewall = true; + servers = { + "no-flicker" = { + enable = true; + package = pkgs.minecraftServers.paper-1_20_4; + }; + }; + }; openssh = { enable = true;