feat(minecraft): add app user capability
This commit is contained in:
parent
a7d23cfec2
commit
ec8116dd92
|
@ -1,7 +1,10 @@
|
||||||
{ pkgs
|
{ pkgs
|
||||||
, lib
|
, lib
|
||||||
, config
|
, config
|
||||||
, ... }: with lib; mkIf config.passthrough.minecraft.enable {
|
, ... }: with lib; let
|
||||||
|
cfg = config.passthrough.minecraft;
|
||||||
|
enable = cfg.enable && (cfg.allUsers || (config.home.username == "app"));
|
||||||
|
in mkIf enable {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
prismlauncher
|
prismlauncher
|
||||||
jdk8
|
jdk8
|
||||||
|
|
|
@ -3,9 +3,11 @@
|
||||||
, config
|
, config
|
||||||
, ... }: with lib; let
|
, ... }: with lib; let
|
||||||
cfg = config.home.minecraft;
|
cfg = config.home.minecraft;
|
||||||
|
persist = [ ".local/share/PrismLauncher" ];
|
||||||
in {
|
in {
|
||||||
options.home.minecraft = {
|
options.home.minecraft = {
|
||||||
enable = mkEnableOption "minecraft game launcher and jvm";
|
enable = mkEnableOption "minecraft game launcher and jvm";
|
||||||
|
allUsers = mkEnableOption "set up for all users";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
@ -14,6 +16,7 @@ in {
|
||||||
{ passthrough.minecraft = cfg; }
|
{ 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;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue