aboutsummaryrefslogtreecommitdiff
path: root/snowfall/modules/home/apps/prismlauncher/default.nix
blob: c6830bab23aeef8e871b7e1b5498bdba481e58b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ options, config, lib, pkgs, namespace, ... }:

with lib; with lib.${namespace}; let
  cfg = config.${namespace}.apps.prismlauncher;
  impermanence = config.${namespace}.impermanence;
in {
  options.${namespace}.apps.prismlauncher = with types; {
    enable = mkEnableOption "prismlauncher";

    extra = {
      rusherhack.enable = mkEnableOption "rusherhack";
    };
  };

  config = mkIf cfg.enable {
    home.packages = with pkgs; [
      prismlauncher
    ];

    home.persistence.${impermanence.location} = {
      directories = [
        ".local/share/PrismLauncher"
      ] ++ optionals cfg.extra.rusherhack.enable [
        #TODO: migrate to proper a secrets management setup, eg agenix/sops-nix
        ".rusherhack"
      ];
    };

    home.file = {
      "Links/PrismLauncher Instances".source = config.lib.file.mkOutOfStoreSymlink (
        "${config.home.homeDirectory}/.local/share/PrismLauncher/instances"
      );
    };
  };
}