fix(minecraft): check gui condition in home

This commit is contained in:
514fpv 2024-05-31 11:20:56 +08:00
parent 7c826861db
commit d9dba8b68a
Signed by: koishi
SSH key fingerprint: SHA256:axz0uIzzY+5W19i7QOUuiw5LSqhKfCBKPf3L4xFRxLw

View file

@ -2,15 +2,15 @@
, lib , lib
, config , config
, ... }: with lib; let , ... }: with lib; let
inherit (config.passthrough) gui;
cfg = config.passthrough.minecraft; cfg = config.passthrough.minecraft;
enable = cfg.enable && config.home.username == "minecraft"; enable = cfg.enable && config.home.username == "minecraft";
in mkIf enable { in mkIf enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
prismlauncher
jdk8 jdk8
]; ] ++ optional gui prismlauncher;
wayland.windowManager.sway.config.window.commands = [ wayland.windowManager.sway.config.window.commands = mkIf gui [
{ criteria.app_id = "org.prismlauncher.PrismLauncher"; command = "floating enable"; } { criteria.app_id = "org.prismlauncher.PrismLauncher"; command = "floating enable"; }
]; ];
} }