Compare commits

..

No commits in common. "c173ea87cfe56cb2e3f091bfda7c230816cf633a" and "83389cb5cf781c2c0c9684d3038d262b50a30499" have entirely different histories.

15 changed files with 100 additions and 314 deletions

View File

@ -35,10 +35,7 @@
homeConfigurations."deck" = home-manager.lib.homeManagerConfiguration { homeConfigurations."deck" = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
extraSpecialArgs = { extraSpecialArgs = { inherit nixgl; };
inherit nixgl;
inherit home-manager;
};
modules = [ modules = [
{ nixpkgs.overlays = [ nixgl.overlay ]; } { nixpkgs.overlays = [ nixgl.overlay ]; }

View File

@ -9,7 +9,6 @@
imports = [ imports = [
./roles/2ship2harkinian ./roles/2ship2harkinian
./roles/ares ./roles/ares
./roles/dolphin
./roles/global_options ./roles/global_options
./roles/graphics ./roles/graphics
./roles/pcsx2 ./roles/pcsx2
@ -18,7 +17,6 @@
./roles/sm64ex ./roles/sm64ex
./roles/steam_rom_manager ./roles/steam_rom_manager
./util/unfree_polyfill ./util/unfree_polyfill
./util/persist_symlink
]; ];
home.username = "deck"; home.username = "deck";

View File

@ -10,7 +10,6 @@
config = { config = {
me.ares.enable = true; me.ares.enable = true;
me.dolphin.enable = true;
me.graphical = true; me.graphical = true;
me.optimizations.enable = true; me.optimizations.enable = true;
me.pcsx2.enable = true; me.pcsx2.enable = true;

View File

@ -1,3 +1,4 @@
# MANUAL: mkdir -p ~/.persist/.local/share/2ship/saves
{ {
config, config,
lib, lib,
@ -38,7 +39,14 @@ in
source = ./files/2ship2harkinian.json; source = ./files/2ship2harkinian.json;
}; };
me.persist.directories = [ ".local/share/2ship/saves" ]; home.persistence."/home/deck/.persist" = {
directories = [
{
directory = ".local/share/2ship/saves";
method = "symlink";
}
];
};
home.persistence."/home/deck/.state" = { home.persistence."/home/deck/.state" = {
files = [ files = [
".local/share/2ship/mm.o2r" ".local/share/2ship/mm.o2r"

View File

@ -1,3 +1,4 @@
# MANUAL: mkdir -p ~/.persist/.local/share/ares/saves ~/.persist/.local/share/ares/screenshots
{ {
config, config,
lib, lib,
@ -33,10 +34,18 @@ in
steam_ares steam_ares
]; ];
me.persist.directories = [ home.persistence."/home/deck/.persist" = {
".local/share/ares/saves" directories = [
".local/share/ares/screenshots" {
directory = ".local/share/ares/saves";
method = "symlink";
}
{
directory = ".local/share/ares/screenshots";
method = "symlink";
}
]; ];
};
home.file.".local/share/ares/settings.bml" = { home.file.".local/share/ares/settings.bml" = {
source = ./files/settings.bml; source = ./files/settings.bml;
@ -55,7 +64,6 @@ in
original_package = original_package =
if config.me.optimizations.enable then if config.me.optimizations.enable then
(optimizeWithFlags prev.ares [ (optimizeWithFlags prev.ares [
# Verified working with ps
"-march=znver2" "-march=znver2"
"-mtune=znver2" "-mtune=znver2"
]) ])

View File

@ -1,104 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
steam_dolphin = pkgs.writeScriptBin "steam_dolphin" ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.libglvnd}/lib"
exec ${pkgs.dolphin-emu}/bin/dolphin-emu "''${@}"
'';
in
{
imports = [ ];
options.me = {
dolphin.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install dolphin.";
};
};
config = lib.mkIf config.me.dolphin.enable (
lib.mkMerge [
(lib.mkIf config.me.graphical {
home.packages = with pkgs; [
dolphin-emu
steam_dolphin
];
home.file.".config/dolphin-emu/Dolphin.ini" = {
source = ./files/Dolphin.ini;
};
home.file.".config/dolphin-emu/GFX.ini" = {
source = ./files/GFX.ini;
};
home.file.".config/dolphin-emu/Profiles/GCPad/deck.ini" = {
source = ./files/deck.ini;
};
home.file.".config/dolphin-emu/GCPadNew.ini" = {
source = ./files/GCPadNew.ini;
};
me.persist.directories = [
".local/share/dolphin-emu/Wii" # The system memory
".local/share/dolphin-emu/Load" # Memory card(s)
".local/share/dolphin-emu/GC" # Gamecube
".local/share/dolphin-emu/ScreenShots" # Screenshots
".local/share/dolphin-emu/GBA/Saves" # GameBoy Advanced
];
me.state.directories = [
".cache/dolphin-emu"
".local/share/dolphin-emu/Shaders"
".local/share/dolphin-emu/StateSaves"
];
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.dolphin-emu [
# Verified working with ps
"-march=znver2"
"-mtune=znver2"
])
else
prev.dolphin-emu;
in
{
dolphin-emu = pkgs.buildEnv {
name = prev.dolphin-emu.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/dolphin-emu.desktop
'';
};
}
)
];
})
]
);
}

View File

@ -1,25 +0,0 @@
[Analytics]
Enabled = False
PermissionAsked = True
[Core]
GFXBackend = Vulkan
# GFXBackend = OGL
SlotA = 8 # GCI Folder (each game gets its own file)
SlotB = 255 # None
WiiSDCard = False
[Display]
RenderToMain = True
[General]
ISOPath0 = /home/deck/.persist/manual/games/nintendo_gamecube/roms
ISOPath1 = /home/deck/.persist/manual/games/nintendo_wii/roms
ISOPaths = 2
RecursiveISOPaths = True
[DSP]
Backend = Cubeb
# Backend = Pulse
# Backend = ALSA
[USBPassthrough]
Devices = 057e:0305
# BluetoothPassthrough must be at the end for the pairings to save properly
[BluetoothPassthrough]
Enabled = True

View File

@ -1,32 +0,0 @@
[GCPad1]
Device = SDL/0/Steam Deck Controller
Buttons/A = `Button S`
Buttons/B = `Button E`
Buttons/X = `Button W`
Buttons/Y = `Button N`
Buttons/Z = `Shoulder R`
Buttons/Start = Start
Main Stick/Up = `Left Y+`
Main Stick/Down = `Left Y-`
Main Stick/Left = `Left X-`
Main Stick/Right = `Left X+`
Main Stick/Modifier = `Thumb L`
Main Stick/Calibration = 100.00 101.96 108.24 120.27 137.87 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 136.32 120.27 108.24 101.96
C-Stick/Up = `Right Y+`
C-Stick/Down = `Right Y-`
C-Stick/Left = `Right X-`
C-Stick/Right = `Right X+`
C-Stick/Modifier = `Thumb R`
C-Stick/Calibration = 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 136.25 120.27 108.24 101.96 100.00 101.96 108.24 120.27 134.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96
D-Pad/Up = `Pad N`
D-Pad/Down = `Pad S`
D-Pad/Left = `Pad W`
D-Pad/Right = `Pad E`
Triggers/L-Analog = `Trigger L`
Triggers/R-Analog = `Trigger R`
[GCPad2]
Device = XInput2/0/Virtual core pointer
[GCPad3]
Device = XInput2/0/Virtual core pointer
[GCPad4]
Device = XInput2/0/Virtual core pointer

View File

@ -1,16 +0,0 @@
# [Enhancements]
#MaxAnisotropy = 4 # 16x Anisotropic texture filtering
# MaxAnisotropy = 2 # 4x Anisotropic texture filtering
#MaxAnisotropy = 1 # 2x Anisotropic texture filtering
#MaxAnisotropy = 0 # default
[Settings]
WaitForShadersBeforeStarting = True
# WaitForShadersBeforeStarting = False
# MSAA = 0x00000004 # 4x MSAA
#MSAA = 0x00000002 # 2x MSAA
#MSAA = 0x00000001 # none
SSAA = False
# InternalResolution = 1 # 2x native
#ShaderCompilationMode = 2 # Hybrid ubershaders
ShaderCompilationMode = 3 # Skip
# ShowGraphs = True

View File

@ -1,26 +0,0 @@
[Profile]
Device = SDL/0/Steam Deck Controller
Buttons/A = `Button S`
Buttons/B = `Button E`
Buttons/X = `Button W`
Buttons/Y = `Button N`
Buttons/Z = `Shoulder R`
Buttons/Start = Start
Main Stick/Up = `Left Y+`
Main Stick/Down = `Left Y-`
Main Stick/Left = `Left X-`
Main Stick/Right = `Left X+`
Main Stick/Modifier = `Thumb L`
Main Stick/Calibration = 100.00 101.96 108.24 120.27 137.87 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 136.32 120.27 108.24 101.96
C-Stick/Up = `Right Y+`
C-Stick/Down = `Right Y-`
C-Stick/Left = `Right X-`
C-Stick/Right = `Right X+`
C-Stick/Modifier = `Thumb R`
C-Stick/Calibration = 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 136.25 120.27 108.24 101.96 100.00 101.96 108.24 120.27 134.42 120.27 108.24 101.96 100.00 101.96 108.24 120.27 141.42 120.27 108.24 101.96
Triggers/L-Analog = `Trigger L`
Triggers/R-Analog = `Trigger R`
D-Pad/Up = `Pad N`
D-Pad/Down = `Pad S`
D-Pad/Left = `Pad W`
D-Pad/Right = `Pad E`

View File

@ -1,3 +1,4 @@
# MANUAL: mkdir -p ~/.persist/.config/PCSX2/memcards ~/.state/.config/PCSX2/cache ~/.state/.config/PCSX2/sstates ~/.state/.config/PCSX2/snaps ~/.state/.config/PCSX2/covers ~/.state/.config/PCSX2/videos
{ {
config, config,
lib, lib,
@ -35,14 +36,38 @@ in
source = ./files/PCSX2.ini; source = ./files/PCSX2.ini;
}; };
me.persist.directories = [ ".config/PCSX2/memcards" ]; home.persistence."/home/deck/.persist" = {
me.state.directories = [ directories = [
".config/PCSX2/cache" {
".config/PCSX2/sstates" directory = ".config/PCSX2/memcards";
".config/PCSX2/snaps" method = "symlink";
".config/PCSX2/covers" }
".config/PCSX2/videos"
]; ];
};
home.persistence."/home/deck/.state" = {
directories = [
{
directory = ".config/PCSX2/cache";
method = "symlink";
}
{
directory = ".config/PCSX2/sstates";
method = "symlink";
}
{
directory = ".config/PCSX2/snaps";
method = "symlink";
}
{
directory = ".config/PCSX2/covers";
method = "symlink";
}
{
directory = ".config/PCSX2/videos";
method = "symlink";
}
];
};
nixpkgs.overlays = [ nixpkgs.overlays = [
( (

View File

@ -1,3 +1,4 @@
# MANUAL: mkdir -p ~/.state/.cache/rpcs3 ~/.persist/.config/rpcs3/dev_hdd0 ~/.persist/.config/rpcs3/dev_hdd1 ~/.persist/.config/rpcs3/savestates ~/.persist/.config/rpcs3/dev_usb000 ~/.persist/.config/rpcs3/dev_flash
{ {
config, config,
lib, lib,
@ -34,14 +35,39 @@ in
# .config/rpcs3/config.yml # .config/rpcs3/config.yml
# .config/rpcs3/GuiConfigs/CurrentSettings.ini # .config/rpcs3/GuiConfigs/CurrentSettings.ini
me.persist.directories = [ home.persistence."/home/deck/.persist" = {
".config/rpcs3/dev_hdd0" directories = [
".config/rpcs3/dev_hdd1" {
".config/rpcs3/savestates" directory = ".config/rpcs3/dev_hdd0";
".config/rpcs3/dev_usb000" method = "symlink";
".config/rpcs3/dev_flash" # Seems to be where the firmware is installed. }
{
directory = ".config/rpcs3/dev_hdd1";
method = "symlink";
}
{
directory = ".config/rpcs3/savestates";
method = "symlink";
}
{
directory = ".config/rpcs3/dev_usb000";
method = "symlink";
}
{
# Seems to be where the firmware is installed.
directory = ".config/rpcs3/dev_flash";
method = "symlink";
}
]; ];
me.state.directories = [ ".cache/rpcs3" ]; };
home.persistence."/home/deck/.state" = {
directories = [
{
directory = ".cache/rpcs3";
method = "symlink";
}
];
};
nixpkgs.overlays = [ nixpkgs.overlays = [
( (

View File

@ -1,3 +1,4 @@
# MANUAL: mkdir -p ~/.persist/.local/share/soh/Save
{ {
config, config,
lib, lib,
@ -38,7 +39,14 @@ in
source = ./files/shipofharkinian.json; source = ./files/shipofharkinian.json;
}; };
me.persist.directories = [ ".local/share/soh/Save" ]; home.persistence."/home/deck/.persist" = {
directories = [
{
directory = ".local/share/soh/Save";
method = "symlink";
}
];
};
home.persistence."/home/deck/.state" = { home.persistence."/home/deck/.state" = {
files = [ files = [
".local/share/soh/oot.otr" ".local/share/soh/oot.otr"

View File

@ -1,3 +1,4 @@
# MANUAL: mkdir -p ~/.persist/.config/steam-rom-manager/userData
{ {
stdenv, stdenv,
config, config,
@ -28,8 +29,6 @@ in
package package
]; ];
me.persist.directories = [ ".config/steam-rom-manager/userData" ];
home.persistence."/home/deck/.persist" = { home.persistence."/home/deck/.persist" = {
directories = [ directories = [
{ {

View File

@ -1,79 +0,0 @@
{
config,
lib,
pkgs,
home-manager,
...
}:
{
imports = [ ];
options.me = {
persist.directories = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
example = [ ".local/share/dolphin-emu/Wii" ];
description = "List of folders relative to the home directory to persist.";
};
state.directories = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
example = [ ".local/share/dolphin-emu/Shaders" ];
description = "List of folders relative to the home directory to keep as state.";
};
};
config = lib.mkMerge [
(lib.mkIf (config.me.persist.directories != [ ]) {
home.persistence."/home/deck/.persist" = {
directories = (
builtins.map (entry: {
directory = entry;
method = "symlink";
}) config.me.persist.directories
);
};
home.activation = {
createPersistDirectories = home-manager.lib.hm.dag.entryAfter [ "writeBoundary" ] (
let
dirlist = lib.strings.escapeShellArgs config.me.persist.directories;
in
''
for dir in ${dirlist} ; do
if [[ ! -d "$HOME/.persist/$dir" ]]; then
$DRY_RUN_CMD mkdir $VERBOSE_ARG -p "$HOME/.persist/$dir"
fi
done
''
);
};
})
(lib.mkIf (config.me.state.directories != [ ]) {
home.persistence."/home/deck/.state" = {
directories = (
builtins.map (entry: {
directory = entry;
method = "symlink";
}) config.me.state.directories
);
};
home.activation = {
createStateDirectories = home-manager.lib.hm.dag.entryAfter [ "writeBoundary" ] (
let
dirlist = lib.strings.escapeShellArgs config.me.state.directories;
in
''
for dir in ${dirlist} ; do
if [[ ! -d "$HOME/.state/$dir" ]]; then
$DRY_RUN_CMD mkdir $VERBOSE_ARG -p "$HOME/.state/$dir"
fi
done
''
);
};
})
];
}