feat(minecraft): make username configurable
This commit is contained in:
parent
d9dba8b68a
commit
bfb06ba476
2 changed files with 10 additions and 5 deletions
|
@ -7,6 +7,11 @@
|
|||
in {
|
||||
options.home.minecraft = {
|
||||
enable = mkEnableOption "minecraft game launcher and jvm";
|
||||
user = mkOption {
|
||||
type = with types; str;
|
||||
default = "minecraft";
|
||||
description = "username which minecraft game client runs under";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
@ -15,14 +20,14 @@ in {
|
|||
{ passthrough.minecraft = cfg; }
|
||||
];
|
||||
|
||||
users.profiles.minecraft = mkIf cfg.enable {
|
||||
users.profiles.minecraft = mkIf (cfg.enable && cfg.user == "minecraft") {
|
||||
uid = 5801;
|
||||
description = "Minecraft";
|
||||
picture = ../picture/aux.png;
|
||||
};
|
||||
|
||||
environment.persistence."/nix/persist".users.minecraft.directories = mkIf (cfg.enable && gui) [
|
||||
".local/share/PrismLauncher"
|
||||
];
|
||||
environment.persistence."/nix/persist".users.${cfg.user} = mkIf (cfg.enable && gui) {
|
||||
directories = [ ".local/share/PrismLauncher" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue