{ pkgs , lib , config , ... }: with lib; let cfg = config.home.minecraft; gui = with config.global.gpu; enable && session; 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; } ]; 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" ]; }; }