Tom Alexander 345c62a477
Add wrappers for 2ship2harkinian and sm64ex also.
Set the steam launcher to run /home/deck/.nix-profile/bin/steam_<GAME> to have it work inside steam gaming mode.
2025-02-15 20:50:34 -05:00

79 lines
2.0 KiB
Nix

# MANUAL: mkdir -p ~/.persist/.local/share/2ship/saves
{
config,
lib,
pkgs,
...
}:
let
steam_2s2h = pkgs.writeScriptBin "steam_2s2h" ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.libglvnd}/lib"
exec ${pkgs._2ship2harkinian}/bin/2s2h
'';
in
{
imports = [ ];
options.me = {
ship2harkinian.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install 2ship2harkinian.";
};
};
config = lib.mkIf config.me.ship2harkinian.enable (
lib.mkMerge [
{
allowedUnfree = [ "2ship2harkinian" ];
}
(lib.mkIf config.me.graphical {
home.packages = with pkgs; [
_2ship2harkinian
steam_2s2h
];
home.file.".local/share/2ship/2ship2harkinian.json" = {
source = ./files/2ship2harkinian.json;
};
home.persistence."/home/deck/.persist" = {
directories = [
{
directory = ".local/share/2ship/saves";
method = "symlink";
}
];
};
home.persistence."/home/deck/.state" = {
files = [
".local/share/2ship/mm.o2r"
];
};
nixpkgs.overlays = [
(final: prev: {
_2ship2harkinian = pkgs.buildEnv {
name = prev._2ship2harkinian.name;
paths = [
(config.lib.nixGL.wrap prev._2ship2harkinian)
];
extraOutputsToInstall = [
"man"
"doc"
"info"
];
# We have to use 555 instead of the normal 444 here because the .desktop file ends up inside $HOME on steam deck and desktop files must be either not in $HOME or must be executable, otherwise KDE Plasma refuses to execute them.
postBuild = ''
chmod 0555 $out/share/applications/2s2h.desktop
'';
};
})
];
})
]
);
}