finished mc config

This commit is contained in:
Chris Kruining 2024-09-10 23:59:12 +02:00
parent bbf6d19757
commit 2505f0ea2e
6 changed files with 228 additions and 69 deletions

View file

@ -5,9 +5,9 @@ let
inherit (lib.modules) mkIf mkMerge;
inherit (lib.strings) concatStrings;
cfg = config.modules.desktop.browsers.firefox;
cfg = config.modules.desktop.browsers.zen;
in {
options.modules.desktop.browsers.firefox = let
options.modules.desktop.browsers.zen = let
inherit (lib.options) mkEnableOption;
inherit (lib.types) attrsOf oneOf bool int lines str;
inherit (lib.my) mkOpt mkOpt';
@ -37,62 +37,56 @@ in {
inherit (inputs.zen.packages.${pkgs.system}.specific) zen;
in [
zen
(makeDesktopItem {
name = "zen";
desktopName = "Zen";
genericName = "Launch a Zen instance";
icon = "zen";
exec = "${lib.getExe zen-bin}";
categories = ["Network" "WebBrowser"];
})
# (makeDesktopItem {
# name = "zen";
# desktopName = "Zen";
# genericName = "Launch a Zen instance";
# icon = "zen";
# exec = "${lib.getExe zen-bin}";
# categories = ["Network" "WebBrowser"];
# })
];
# Use a stable profile name so we can target it in themes
home.file = let
cfgPath = ".mozilla/firefox";
in {
firefox-profiles = {
target = "${cfgPath}/profiles.ini";
text = ''
[Profile0]
Name=default
IsRelative=1
Path=${cfg.profileName}.default
Default=1
[General]
StartWithLastProfile=1
Version=2
'';
};
user-js = mkIf (cfg.settings != {} || cfg.extraConfig != "") {
target = "${cfgPath}/${cfg.profileName}.default/user.js";
text = ''
${concatStrings (mapAttrsToList (name: value: ''
user_pref("${name}", ${toJSON value});
'')
cfg.settings)}
${cfg.extraConfig}
'';
};
user-chrome = mkIf (cfg.userChrome != "") {
target = "${cfgPath}/${cfg.profileName}.default/chrome/userChrome.css";
text = cfg.userChrome;
};
user-content = mkIf (cfg.userContent != "") {
target = "${cfgPath}/${cfg.profileName}.default/chrome/userContent.css";
text = cfg.userContent;
};
};
})
(mkIf cfg.privacy.enable {
user.packages = attrValues {
inherit (pkgs) librewolf;
};
# home.file = let
# cfgPath = ".mozilla/firefox";
# in {
# firefox-profiles = {
# target = "${cfgPath}/profiles.ini";
# text = ''
# [Profile0]
# Name=default
# IsRelative=1
# Path=${cfg.profileName}.default
# Default=1
#
# [General]
# StartWithLastProfile=1
# Version=2
# '';
# };
#
# user-js = mkIf (cfg.settings != {} || cfg.extraConfig != "") {
# target = "${cfgPath}/${cfg.profileName}.default/user.js";
# text = ''
# ${concatStrings (mapAttrsToList (name: value: ''
# user_pref("${name}", ${toJSON value});
# '')
# cfg.settings)}
# ${cfg.extraConfig}
# '';
# };
#
# user-chrome = mkIf (cfg.userChrome != "") {
# target = "${cfgPath}/${cfg.profileName}.default/chrome/userChrome.css";
# text = cfg.userChrome;
# };
#
# user-content = mkIf (cfg.userContent != "") {
# target = "${cfgPath}/${cfg.profileName}.default/chrome/userContent.css";
# text = cfg.userContent;
# };
# };
})
];
}

View file

@ -9,10 +9,46 @@ in
enable = mkEnableOption "Minecraft";
};
config = mkIf config.modules.services.auth.enable {
services.minecraft = {
config = mkIf config.modules.services.games.minecraft.enable {
services.minecraft-servers = {
enable = true;
eula = true;
dataDir = "/var/lib/minecraft";
servers = {
vanilla = {
enable = true;
autoStart = true;
package = pkgs.fabricServers.fabric-1_18_2.override { loaderVersion = "0.14.9"; };
serverProperties = {
gamemode = "survival";
difficulty = 3;
motd = "Chris' vanilla server";
white-list = true;
simulation-distance = 10;
server-port = 25501;
};
whitelist = {
ChrisPBacon = "e6128495-075b-44a9-87f6-8d844d5ea0e4";
};
jvmOpts = "-Xms4092M -Xmx4092M -XX:+UseG1GC";
symlinks = let
inherit (lib.attrsets) attrValues;
inherit (pkgs) linkFarmFromDrvs fetchurl;
in{
mods = linkFarmFromDrvs "mods" (attrValues {
Terraforged = fetchurl { url = "https://cdn.modrinth.com/data/FIlZB9L0/versions/EVe9wYaj/Terra-fabric-6.4.3-BETA%2Bab60f14ff.jar"; sha512 = "90dc1215b352fcbce0219dab616dc2be28eaff4622233cbfadd6060aa52432f2ba86f05f1118314b46102b3ab3c6f8070e6780cf6512a8961ac47c235dd764f9"; };
DistantHorizons = fetchurl { url = "https://cdn.modrinth.com/data/uCdwusMi/versions/jptcCdp2/DistantHorizons-2.2.1-a-1.20.4-forge-fabric.jar"; sha512 = "47368d91099d0b5f364339a69f4e425f8fb1e3a7c3250a8b649da76135e68a22f1a76b191c87e15a5cdc0a1d36bc57f2fa825490d96711d09d96807be97d575d"; };
});
};
};
};
};
};
}