Add Spaghetti Kart to the Steam Deck.

This commit is contained in:
Tom Alexander 2025-09-12 21:01:45 -04:00
parent c72141e070
commit d0f23c0cb1
No known key found for this signature in database
GPG Key ID: D3A179C9A53C0EDE
6 changed files with 142 additions and 17 deletions

View File

@ -1,12 +1,15 @@
{ {
"nodes": { "nodes": {
"flake-utils": { "flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": { "locked": {
"lastModified": 1659877975, "lastModified": 1731533236,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -22,11 +25,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739314552, "lastModified": 1757698511,
"narHash": "sha256-ggVf2BclyIW3jexc/uvgsgJH4e2cuG6Nyg54NeXgbFI=", "narHash": "sha256-UqHHGydF/q3jfYXCpvYLA0TWtvByOp1NwOKCUjhYmPs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "83bd3a26ac0526ae04fa74df46738bb44b89dcdd", "rev": "a3fcc92180c7462082cd849498369591dfb20855",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -58,11 +61,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1713543440, "lastModified": 1752054764,
"narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=", "narHash": "sha256-Ob/HuUhANoDs+nvYqyTKrkcPXf4ZgXoqMTQoCK0RFgQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixGL", "repo": "nixGL",
"rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a", "rev": "a8e1ce7d49a149ed70df676785b07f63288f53c5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -73,11 +76,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1739138025, "lastModified": 1757746433,
"narHash": "sha256-M4ilIfGxzbBZuURokv24aqJTbdjPA9K+DtKUzrJaES4=", "narHash": "sha256-fEvTiU4s9lWgW7mYEU/1QUPirgkn+odUBTaindgiziY=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b2243f41e860ac85c0b446eadc6930359b294e79", "rev": "6d7ec06d6868ac6d94c371458fc2391ded9ff13d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -94,6 +97,21 @@
"nixgl": "nixgl", "nixgl": "nixgl",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@ -4,8 +4,10 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixgl.url = "github:nix-community/nixGL"; nixgl = {
nixgl.inputs.nixpkgs.follows = "nixpkgs"; url = "github:nix-community/nixGL";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -23,6 +25,7 @@
... ...
}: }:
let let
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
@ -31,7 +34,7 @@
in in
# pkgs = nixpkgs.legacyPackages.${system}; # pkgs = nixpkgs.legacyPackages.${system};
{ {
defaultPackage.${system} = home-manager.defaultPackage.${system}; defaultPackage.${system} = home-manager.packages.${system}.default;
homeConfigurations."deck" = home-manager.lib.homeManagerConfiguration { homeConfigurations."deck" = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;

View File

@ -18,6 +18,7 @@
./roles/ryujinx ./roles/ryujinx
./roles/shipwright ./roles/shipwright
./roles/sm64ex ./roles/sm64ex
./roles/spaghettikart
./roles/steam_rom_manager ./roles/steam_rom_manager
./roles/yuzu ./roles/yuzu
./util/copy_files ./util/copy_files

View File

@ -11,15 +11,16 @@
config = { config = {
me.ares.enable = true; me.ares.enable = true;
me.dolphin.enable = true; me.dolphin.enable = true;
me.duckstation.enable = true; me.duckstation.enable = false;
me.graphical = true; me.graphical = true;
me.optimizations.enable = true; me.optimizations.enable = true;
me.pcsx2.enable = true; me.pcsx2.enable = true;
me.rpcs3.enable = true; me.rpcs3.enable = true;
me.ryujinx.enable = true; me.ryujinx.enable = true;
me.ship2harkinian.enable = true; me.ship2harkinian.enable = true;
me.shipwright.enable = true; me.shipwright.enable = false;
me.sm64ex.enable = true; me.sm64ex.enable = true;
me.spaghettikart.enable = false;
me.steam_rom_manager.enable = true; # Steam rom manager UI does not render. I think it wants to be in an AppImage. me.steam_rom_manager.enable = true; # Steam rom manager UI does not render. I think it wants to be in an AppImage.
me.yuzu.enable = true; me.yuzu.enable = true;
}; };

View File

@ -0,0 +1,88 @@
{
config,
lib,
pkgs,
...
}:
let
steam_spaghettikart = pkgs.writeScriptBin "steam_Spaghettify" ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.libglvnd}/lib"
exec ${pkgs.spaghettikart}/bin/Spaghettify "''${@}"
'';
in
{
imports = [ ];
options.me = {
spaghettikart.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install spaghettikart.";
};
};
config = lib.mkIf config.me.spaghettikart.enable (
lib.mkMerge [
{
allowedUnfree = [ "spaghettikart" ];
}
(lib.mkIf config.me.graphical {
home.packages = with pkgs; [
spaghettikart
steam_spaghettikart
];
home.file.".local/share/spaghettikart/spaghettify.cfg.json" = {
source = ./files/spaghettify.cfg.json;
};
home.persistence."/home/deck/.persist" = {
files = [
".local/share/spaghettikart/default.sav"
".local/share/spaghettikart/mk64.o2r"
];
};
nixpkgs.overlays = [
(
final: prev:
let
optimizeWithFlags =
pkg: flags:
pkg.overrideAttrs (old: {
NIX_CFLAGS_COMPILE = [ (old.NIX_CFLAGS_COMPILE or "") ] ++ flags;
});
original_package =
if config.me.optimizations.enable then
(optimizeWithFlags prev.spaghettikart [
"-march=znver2"
"-mtune=znver2"
])
else
prev.spaghettikart;
in
{
spaghettikart = pkgs.buildEnv {
name = prev.spaghettikart.name;
paths = [
(config.lib.nixGL.wrap original_package)
];
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/SpaghettiKart.desktop
'';
};
}
)
];
})
]
);
}

View File

@ -0,0 +1,14 @@
{
"CVars": {
"gDisableLod": 1,
"gMSAAValue": 2,
"gShowSpaghettiVersion": 0,
"gSkipIntro": 1,
"gVsyncEnabled": 1
},
"Window": {
"Fullscreen": {
"Enabled": true
}
}
}