summary refs log tree commit diff
path: root/pkgs/games/space-station-14-launcher/default.nix
diff options
context:
space:
mode:
authorVera Aguilera Puerto <gradientvera@outlook.com>2023-03-24 22:57:20 +0100
committerVera Aguilera Puerto <gradientvera@outlook.com>2023-04-24 12:08:31 +0200
commitc768d8ff7292e770b29bc57b7e1bb71070e03691 (patch)
tree6da90eed9b00cd33eac19dcd3f4d31426dc181a7 /pkgs/games/space-station-14-launcher/default.nix
parent3d2b0f145e831fa6aa4f437bd45452788b0fb718 (diff)
downloadnixpkgs-c768d8ff7292e770b29bc57b7e1bb71070e03691.tar
nixpkgs-c768d8ff7292e770b29bc57b7e1bb71070e03691.tar.gz
nixpkgs-c768d8ff7292e770b29bc57b7e1bb71070e03691.tar.bz2
nixpkgs-c768d8ff7292e770b29bc57b7e1bb71070e03691.tar.lz
nixpkgs-c768d8ff7292e770b29bc57b7e1bb71070e03691.tar.xz
nixpkgs-c768d8ff7292e770b29bc57b7e1bb71070e03691.tar.zst
nixpkgs-c768d8ff7292e770b29bc57b7e1bb71070e03691.zip
space-station-14-launcher: init at 0.20.5
Diffstat (limited to 'pkgs/games/space-station-14-launcher/default.nix')
-rw-r--r--pkgs/games/space-station-14-launcher/default.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/games/space-station-14-launcher/default.nix b/pkgs/games/space-station-14-launcher/default.nix
new file mode 100644
index 00000000000..606f0659c78
--- /dev/null
+++ b/pkgs/games/space-station-14-launcher/default.nix
@@ -0,0 +1,40 @@
+{ soundfont-fluid
+, buildFHSEnv
+, runCommand
+, callPackage
+}:
+
+let
+  space-station-14-launcher = callPackage ./space-station-14-launcher.nix { };
+
+  # Workaround for hardcoded soundfont paths in downloaded engine assemblies.
+  soundfont-fluid-fixed = runCommand "soundfont-fluid-fixed" { } ''
+    mkdir -p "$out/share/soundfonts"
+    ln -sf ${soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2 $out/share/soundfonts/FluidR3_GM.sf2
+  '';
+in
+buildFHSEnv rec {
+  name = "space-station-14-launcher-wrapped";
+
+  targetPkgs = pkgs: [
+    space-station-14-launcher
+    soundfont-fluid-fixed
+  ];
+
+  runScript = "SS14.Launcher";
+
+  extraInstallCommands = ''
+    mkdir -p $out/share/applications
+    ln -s ${space-station-14-launcher}/share/icons $out/share
+    cp ${space-station-14-launcher}/share/applications/space-station-14-launcher.desktop "$out/share/applications"
+    substituteInPlace "$out/share/applications/space-station-14-launcher.desktop" \
+        --replace ${space-station-14-launcher.meta.mainProgram} ${meta.mainProgram}
+  '';
+
+  passthru = space-station-14-launcher.passthru // {
+    unwrapped = space-station-14-launcher;
+  };
+  meta = space-station-14-launcher.meta // {
+    mainProgram = name;
+  };
+}