2024-01-05 22:24:55 +08:00
|
|
|
{ pkgs
|
|
|
|
, lib
|
|
|
|
, config
|
|
|
|
, ... }: with lib; let
|
|
|
|
cfg = config.home.minecraft;
|
2024-05-31 11:09:20 +08:00
|
|
|
gui = with config.global.gpu; enable && session;
|
2024-01-05 22:24:55 +08:00
|
|
|
in {
|
|
|
|
options.home.minecraft = {
|
|
|
|
enable = mkEnableOption "minecraft game launcher and jvm";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
|
|
|
users.homeModules = [
|
|
|
|
# this module passes minecraft configuration to home-manager
|
|
|
|
{ passthrough.minecraft = cfg; }
|
|
|
|
];
|
|
|
|
|
2024-05-31 11:09:20 +08:00
|
|
|
users.profiles.minecraft = mkIf cfg.enable {
|
|
|
|
uid = 5801;
|
|
|
|
description = "Minecraft";
|
|
|
|
picture = ../picture/aux.png;
|
|
|
|
};
|
|
|
|
|
|
|
|
environment.persistence."/nix/persist".users.minecraft.directories = mkIf (cfg.enable && gui) [
|
|
|
|
".local/share/PrismLauncher"
|
|
|
|
];
|
2024-01-05 22:24:55 +08:00
|
|
|
};
|
|
|
|
}
|