about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2022-08-25 14:32:01 +0300
committerAzat Bahawi <azat@bahawi.net>2022-08-25 14:32:01 +0300
commit6ec5f8344117e6277bd225e6a178839f5648f36a (patch)
tree0735fee3417cb09174a536130bdaac47785a3d9c
parent2022-08-24 (diff)
2022-08-25
-rw-r--r--flake.lock47
-rw-r--r--flake.nix25
-rw-r--r--modules/nixfiles/common/home-manager.nix10
-rw-r--r--modules/nixfiles/common/nix/default.nix1
-rw-r--r--modules/nixfiles/fonts.nix1
-rw-r--r--modules/nixfiles/games/minecraft.nix26
-rw-r--r--modules/nixfiles/profiles/common.nix3
7 files changed, 91 insertions, 22 deletions
diff --git a/flake.lock b/flake.lock
index c6028b1..bc40af0 100644
--- a/flake.lock
+++ b/flake.lock
@@ -280,6 +280,27 @@
         "type": "github"
       }
     },
+    "flake-utils-plus": {
+      "inputs": {
+        "flake-utils": [
+          "flake-utils"
+        ]
+      },
+      "locked": {
+        "lastModified": 1657226504,
+        "narHash": "sha256-GIYNjuq4mJlFgqKsZ+YrgzWm0IpA4axA3MCrdKYj7gs=",
+        "owner": "gytis-ivaskevicius",
+        "repo": "flake-utils-plus",
+        "rev": "2bf0f91643c2e5ae38c1b26893ac2927ac9bd82a",
+        "type": "github"
+      },
+      "original": {
+        "owner": "gytis-ivaskevicius",
+        "ref": "master",
+        "repo": "flake-utils-plus",
+        "type": "github"
+      }
+    },
     "format-all": {
       "flake": false,
       "locked": {
@@ -370,6 +391,30 @@
         "type": "github"
       }
     },
+    "nix-minecraft-servers": {
+      "inputs": {
+        "nixpkgs": [
+          "nixpkgs"
+        ],
+        "utils": [
+          "flake-utils-plus"
+        ]
+      },
+      "locked": {
+        "lastModified": 1661219530,
+        "narHash": "sha256-jLKEpwbkp3ryXho5RT5hjhLjBOZelGm6X5JWUUxuwsA=",
+        "owner": "jyooru",
+        "repo": "nix-minecraft-servers",
+        "rev": "e624f6c056d95df8d6335d12bed0fe3c5af05159",
+        "type": "github"
+      },
+      "original": {
+        "owner": "jyooru",
+        "ref": "main",
+        "repo": "nix-minecraft-servers",
+        "type": "github"
+      }
+    },
     "nix-straight": {
       "flake": false,
       "locked": {
@@ -644,8 +689,10 @@
         "emacs-overlay": "emacs-overlay",
         "flake-registry": "flake-registry",
         "flake-utils": "flake-utils",
+        "flake-utils-plus": "flake-utils-plus",
         "home-manager": "home-manager",
         "nix-doom-emacs": "nix-doom-emacs",
+        "nix-minecraft-servers": "nix-minecraft-servers",
         "nixos-hardware": "nixos-hardware",
         "nixpkgs": "nixpkgs",
         "nixpkgs-master": "nixpkgs-master",
diff --git a/flake.nix b/flake.nix
index 4165cbe..d042cff 100644
--- a/flake.nix
+++ b/flake.nix
@@ -27,6 +27,7 @@
       ref = "release-22.05";
     };
 
+    # For testing PRs and stuff.
     # nixpkgs-local = {
     #   type = "path";
     #   path = "/home/azahi/src/nixpkgs";
@@ -80,6 +81,17 @@
       };
     };
 
+    nix-minecraft-servers = {
+      type = "github";
+      owner = "jyooru";
+      repo = "nix-minecraft-servers";
+      ref = "main";
+      inputs = {
+        nixpkgs.follows = "nixpkgs";
+        utils.follows = "flake-utils-plus";
+      };
+    };
+
     dns-nix = {
       type = "github";
       owner = "kirelagin";
@@ -121,6 +133,19 @@
       inputs.nixpkgs.follows = "nixpkgs";
     };
 
+    # NOTE Used indirectly by nix-minecraft-servers.
+    # This is declared explicitly because nested follows are broken[1].
+    #
+    # [1]: https://github.com/NixOS/nix/issues/5790
+    # [1]: https://github.com/NixOS/nix/pull/6621
+    flake-utils-plus = {
+      type = "github";
+      owner = "gytis-ivaskevicius";
+      repo = "flake-utils-plus";
+      ref = "master";
+      inputs.flake-utils.follows = "flake-utils";
+    };
+
     flake-registry = {
       type = "github";
       owner = "NixOS";
diff --git a/modules/nixfiles/common/home-manager.nix b/modules/nixfiles/common/home-manager.nix
index e4c5d3b..3e715bb 100644
--- a/modules/nixfiles/common/home-manager.nix
+++ b/modules/nixfiles/common/home-manager.nix
@@ -17,6 +17,16 @@ with lib; {
     useUserPackages = true;
     useGlobalPkgs = true;
     verbose = true;
+
+    # TODO You know what to do.
+    users = {
+      root.home = {
+        inherit (config.system) stateVersion;
+      };
+      ${my.username}.home = {
+        inherit (config.system) stateVersion;
+      };
+    };
   };
 
   system.extraDependencies = [inputs.home-manager];
diff --git a/modules/nixfiles/common/nix/default.nix b/modules/nixfiles/common/nix/default.nix
index 4213a29..4e995d3 100644
--- a/modules/nixfiles/common/nix/default.nix
+++ b/modules/nixfiles/common/nix/default.nix
@@ -110,6 +110,7 @@ with lib; {
         }))
       agenix.overlay
       emacs-overlay.overlay
+      nix-minecraft-servers.overlays.default
       nur.overlay
       xmonad-ng.overlays.default
     ];
diff --git a/modules/nixfiles/fonts.nix b/modules/nixfiles/fonts.nix
index 042c0e8..18c6f52 100644
--- a/modules/nixfiles/fonts.nix
+++ b/modules/nixfiles/fonts.nix
@@ -81,6 +81,7 @@ in {
   };
 
   config = mkMerge [
+    {home-manager.users.root.fonts.fontconfig.enable = false;}
     (mkIf cfg.enable {
       hm.fonts.fontconfig.enable = true;
 
diff --git a/modules/nixfiles/games/minecraft.nix b/modules/nixfiles/games/minecraft.nix
index 3936eaa..4f3908b 100644
--- a/modules/nixfiles/games/minecraft.nix
+++ b/modules/nixfiles/games/minecraft.nix
@@ -25,8 +25,8 @@ in {
   config = mkMerge [
     (mkIf cfg.client.enable {
       hm.home.packages = with pkgs; [
-        UltimMC
-        jre
+        UltimMC # I refuse to use a Microsoft account.
+        jre # Unfortunately, this cannot be provided as a PATH injection to UltimMC.
       ];
     })
     (mkIf cfg.server.enable {
@@ -34,32 +34,14 @@ in {
         enable = true;
         eula = true;
 
-        # TODO After the PR is merged, I need to somehow pin this.
-        package = (pkgsPR "187458" "sha256-kOYkuXvcmqt8Lsh0yMr8reurzU1qTrzh0Z/Tjan0IF0=").papermc;
+        package = pkgs.minecraftServers.purpur_1_19_2;
 
         # TODO Make PR fixing trailing whitespace on this.
         jvmOpts =
           (concatStringsSep " " [
             "-Xmx${cfg.server.memory}"
             "-Xms${cfg.server.memory}"
-            # "-XX:+AlwaysPreTouch"
-            # "-XX:+DisableExplicitGC"
-            # "-XX:+ParallelRefProcEnabled"
-            # "-XX:+PerfDisableSharedMem"
-            # "-XX:+UnlockExperimentalVMOptions"
-            # "-XX:+UseG1GC"
-            # "-XX:G1HeapRegionSize=8M"
-            # "-XX:G1HeapWastePercent=5"
-            # "-XX:G1MaxNewSizePercent=40"
-            # "-XX:G1MixedGCCountTarget=4"
-            # "-XX:G1MixedGCLiveThresholdPercent=90"
-            # "-XX:G1NewSizePercent=30"
-            # "-XX:G1RSetUpdatingPauseTimePercent=5"
-            # "-XX:G1ReservePercent=20"
-            # "-XX:InitiatingHeapOccupancyPercent=15"
-            # "-XX:MaxGCPauseMillis=200"
-            # "-XX:MaxTenuringThreshold=1"
-            # "-XX:SurvivorRatio=32"
+            "--add-modules=jdk.incubator.vector"
           ])
           + " ";
 
diff --git a/modules/nixfiles/profiles/common.nix b/modules/nixfiles/profiles/common.nix
index dd287dc..3f77da6 100644
--- a/modules/nixfiles/profiles/common.nix
+++ b/modules/nixfiles/profiles/common.nix
@@ -75,6 +75,9 @@ in {
       vim.enable = true;
     };
 
+    home-manager.users.root.home.file.".bash_history".source =
+      config.hm.lib.file.mkOutOfStoreSymlink "/dev/null";
+
     hm.home.language = {
       collate = "C";
       messages = "C";

Consider giving Nix/NixOS a try! <3