From cc2b1a7125d18530b6ad7efc5a6f0de5977ca39e Mon Sep 17 00:00:00 2001 From: 514fpv Date: Fri, 5 Jan 2024 22:24:55 +0800 Subject: [PATCH] feat(minecraft): add prism launcher --- home/minecraft/home.nix | 6 ++++++ home/minecraft/nixos.nix | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 home/minecraft/home.nix create mode 100644 home/minecraft/nixos.nix diff --git a/home/minecraft/home.nix b/home/minecraft/home.nix new file mode 100644 index 00000000..bb7cce9d --- /dev/null +++ b/home/minecraft/home.nix @@ -0,0 +1,6 @@ +{ pkgs +, lib +, config +, ... }: with lib; mkIf config.passthrough.minecraft.enable { + home.packages = with pkgs; [ prismlauncher ]; +} diff --git a/home/minecraft/nixos.nix b/home/minecraft/nixos.nix new file mode 100644 index 00000000..ca2646a6 --- /dev/null +++ b/home/minecraft/nixos.nix @@ -0,0 +1,19 @@ +{ pkgs +, lib +, config +, ... }: with lib; let + cfg = config.home.minecraft; +in { + options.home.minecraft = { + enable = mkEnableOption "minecraft game launcher and jvm"; + }; + + config = { + users.homeModules = [ + # this module passes minecraft configuration to home-manager + { passthrough.minecraft = cfg; } + ]; + + users.home.persist.directories = [ ".local/share/PrismLauncher" ]; + }; +}