nixos/home/minecraft/nixos.nix

23 lines
607 B
Nix
Raw Normal View History

2024-01-05 22:24:55 +08:00
{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.home.minecraft;
persist = [ ".local/share/PrismLauncher" ];
2024-01-05 22:24:55 +08:00
in {
options.home.minecraft = {
enable = mkEnableOption "minecraft game launcher and jvm";
allUsers = mkEnableOption "set up for all users";
2024-01-05 22:24:55 +08:00
};
config = {
users.homeModules = [
# this module passes minecraft configuration to home-manager
{ passthrough.minecraft = cfg; }
];
users.home.persist.directories = with cfg; mkIf (enable && allUsers) persist;
users.home.persistApp.directories = with cfg; mkIf (enable && !allUsers) persist;
2024-01-05 22:24:55 +08:00
};
}