feat(minecraft): add app user capability

This commit is contained in:
514fpv 2024-01-07 21:51:12 +08:00
parent a7d23cfec2
commit ec8116dd92
Signed by: koishi
SSH key fingerprint: SHA256:axz0uIzzY+5W19i7QOUuiw5LSqhKfCBKPf3L4xFRxLw
2 changed files with 8 additions and 2 deletions

View file

@ -3,9 +3,11 @@
, config
, ... }: with lib; let
cfg = config.home.minecraft;
persist = [ ".local/share/PrismLauncher" ];
in {
options.home.minecraft = {
enable = mkEnableOption "minecraft game launcher and jvm";
allUsers = mkEnableOption "set up for all users";
};
config = {
@ -14,6 +16,7 @@ in {
{ passthrough.minecraft = cfg; }
];
users.home.persist.directories = mkIf cfg.enable [ ".local/share/PrismLauncher" ];
users.home.persist.directories = with cfg; mkIf (enable && allUsers) persist;
users.home.persistApp.directories = with cfg; mkIf (enable && !allUsers) persist;
};
}