|
98 | 98 | environment.systemPackages = [ (mkIf cfg.keyb0xx.enable (pkgs.keyb0xx.override { keyb0xxconfig = cfg.keyb0xx.config; })) ];
|
99 | 99 | };
|
100 | 100 | };
|
| 101 | + homeManagerModule = { pkgs, config, ... }: |
| 102 | + let |
| 103 | + cfg = config.ssbm; |
| 104 | + in |
| 105 | + with nixpkgs.lib; { |
| 106 | + options.ssbm = { |
| 107 | + slippi-launcher = { |
| 108 | + enable = mkEnableOption "Install Slippi Launcher"; |
| 109 | + # Game settings |
| 110 | + isoPath = mkOption { |
| 111 | + default = ""; |
| 112 | + type = types.str; |
| 113 | + description = "The path to an NTSC Melee ISO."; |
| 114 | + }; |
| 115 | + launchMeleeOnPlay = mkEnableOption "Launch Melee in Dolphin when the Play button is pressed." // { default = true; }; |
| 116 | + enableJukebox = mkEnableOption "Enable in-game music via Slippi Jukebox. Incompatible with WASAPI." // { default = true; }; |
| 117 | + # Replay settings |
| 118 | + rootSlpPath = mkOption { |
| 119 | + default = "${config.home.homeDirectory}/Slippi"; |
| 120 | + type = types.str; |
| 121 | + description = "The folder where your SLP replays should be saved."; |
| 122 | + }; |
| 123 | + useMonthlySubfolders = mkEnableOption "Save replays to monthly subfolders"; |
| 124 | + spectateSlpPath = mkOption { |
| 125 | + default = "${cfg.slippi-launcher.rootSlpPath}/Spectate"; |
| 126 | + type = types.nullOr types.str; |
| 127 | + description = "The folder where spectated games should be saved."; |
| 128 | + }; |
| 129 | + extraSlpPaths = mkOption { |
| 130 | + default = [ ]; |
| 131 | + type = types.listOf types.str; |
| 132 | + description = "Choose any additional SLP directories that should show up in the replay browser."; |
| 133 | + }; |
| 134 | + # Netplay |
| 135 | + netplayDolphinPath = mkOption { |
| 136 | + default = "${pkgs.slippi-netplay}"; |
| 137 | + type = types.str; |
| 138 | + description = "The path to the folder containing the Netplay Dolphin Executable"; |
| 139 | + }; |
| 140 | + # Playback |
| 141 | + playbackDolphinPath = mkOption { |
| 142 | + default = "${pkgs.slippi-playback}"; |
| 143 | + type = types.str; |
| 144 | + description = "The path to the folder containing the Playback Dolphin Executable"; |
| 145 | + }; |
| 146 | + }; |
| 147 | + }; |
| 148 | + config = { |
| 149 | + home.packages = [ (mkIf cfg.slippi-launcher.enable pkgs.slippi-launcher) ]; |
| 150 | + xdg.configFile."Slippi Launcher/Settings".source = |
| 151 | + let |
| 152 | + jsonFormat = pkgs.formats.json { }; |
| 153 | + in |
| 154 | + jsonFormat.generate "slippi-config" { |
| 155 | + settings = { |
| 156 | + isoPath = cfg.slippi-launcher.isoPath; |
| 157 | + launchMeleeOnPlay = cfg.slippi-launcher.launchMeleeOnPlay; |
| 158 | + enableJukebox = cfg.slippi-launcher.enableJukebox; |
| 159 | + # Replay settings |
| 160 | + rootSlpPath = cfg.slippi-launcher.rootSlpPath; |
| 161 | + useMonthlySubfolders = cfg.slippi-launcher.useMonthlySubfolders; |
| 162 | + spectateSlpPath = cfg.slippi-launcher.spectateSlpPath; |
| 163 | + extraSlpPaths = cfg.slippi-launcher.extraSlpPaths; |
| 164 | + # Netplay |
| 165 | + netplayDolphinPath = cfg.slippi-launcher.netplayDolphinPath; |
| 166 | + # Playback |
| 167 | + playbackDolphinPath = cfg.slippi-launcher.playbackDolphinPath; |
| 168 | + # Advanced settings |
| 169 | + autoUpdateLauncher = false; |
| 170 | + }; |
| 171 | + }; |
| 172 | + }; |
| 173 | + }; |
101 | 174 | };
|
102 | 175 | }
|
0 commit comments