Merge branch 'rpcs3' into nix
This commit is contained in:
commit
996cb27a89
@ -32,6 +32,7 @@
|
|||||||
./roles/graphics
|
./roles/graphics
|
||||||
./roles/hydra
|
./roles/hydra
|
||||||
./roles/iso
|
./roles/iso
|
||||||
|
./roles/iso_mount
|
||||||
./roles/kanshi
|
./roles/kanshi
|
||||||
./roles/kodi
|
./roles/kodi
|
||||||
./roles/kubernetes
|
./roles/kubernetes
|
||||||
@ -49,6 +50,7 @@
|
|||||||
./roles/python
|
./roles/python
|
||||||
./roles/qemu
|
./roles/qemu
|
||||||
./roles/reset
|
./roles/reset
|
||||||
|
./roles/rpcs3
|
||||||
./roles/rust
|
./roles/rust
|
||||||
./roles/shikane
|
./roles/shikane
|
||||||
./roles/shipwright
|
./roles/shipwright
|
||||||
|
@ -75,6 +75,7 @@
|
|||||||
me.gpg.enable = true;
|
me.gpg.enable = true;
|
||||||
me.graphical = true;
|
me.graphical = true;
|
||||||
me.graphics_card_type = "amd";
|
me.graphics_card_type = "amd";
|
||||||
|
me.iso_mount.enable = true;
|
||||||
me.kanshi.enable = false;
|
me.kanshi.enable = false;
|
||||||
me.kubernetes.enable = true;
|
me.kubernetes.enable = true;
|
||||||
me.latex.enable = true;
|
me.latex.enable = true;
|
||||||
@ -85,6 +86,7 @@
|
|||||||
me.pcsx2.enable = true;
|
me.pcsx2.enable = true;
|
||||||
me.python.enable = true;
|
me.python.enable = true;
|
||||||
me.qemu.enable = true;
|
me.qemu.enable = true;
|
||||||
|
me.rpcs3.enable = true;
|
||||||
me.rust.enable = true;
|
me.rust.enable = true;
|
||||||
me.shikane.enable = true;
|
me.shikane.enable = true;
|
||||||
me.sops.enable = true;
|
me.sops.enable = true;
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
./wifi.nix
|
./wifi.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
config = {
|
||||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||||
networking.hostId = "47ee7d7c";
|
networking.hostId = "47ee7d7c";
|
||||||
|
|
||||||
@ -49,6 +50,9 @@
|
|||||||
# Enable TRIM
|
# Enable TRIM
|
||||||
# services.fstrim.enable = lib.mkDefault true;
|
# services.fstrim.enable = lib.mkDefault true;
|
||||||
|
|
||||||
|
# RPCS3 has difficulty with znver5
|
||||||
|
me.rpcs3.config.Core."Use LLVM CPU" = "znver4";
|
||||||
|
|
||||||
me.alacritty.enable = true;
|
me.alacritty.enable = true;
|
||||||
me.ansible.enable = true;
|
me.ansible.enable = true;
|
||||||
me.ares.enable = true;
|
me.ares.enable = true;
|
||||||
@ -66,6 +70,7 @@
|
|||||||
me.gpg.enable = true;
|
me.gpg.enable = true;
|
||||||
me.graphical = true;
|
me.graphical = true;
|
||||||
me.graphics_card_type = "amd";
|
me.graphics_card_type = "amd";
|
||||||
|
me.iso_mount.enable = true;
|
||||||
me.kanshi.enable = false;
|
me.kanshi.enable = false;
|
||||||
me.kubernetes.enable = true;
|
me.kubernetes.enable = true;
|
||||||
me.latex.enable = true;
|
me.latex.enable = true;
|
||||||
@ -77,6 +82,7 @@
|
|||||||
me.pcsx2.enable = true;
|
me.pcsx2.enable = true;
|
||||||
me.python.enable = true;
|
me.python.enable = true;
|
||||||
me.qemu.enable = true;
|
me.qemu.enable = true;
|
||||||
|
me.rpcs3.enable = true;
|
||||||
me.rust.enable = true;
|
me.rust.enable = true;
|
||||||
me.shikane.enable = true;
|
me.shikane.enable = true;
|
||||||
me.sops.enable = true;
|
me.sops.enable = true;
|
||||||
@ -103,4 +109,5 @@
|
|||||||
me.sm64ex.enable = true;
|
me.sm64ex.enable = true;
|
||||||
me.shipwright.enable = true;
|
me.shipwright.enable = true;
|
||||||
me.ship2harkinian.enable = true;
|
me.ship2harkinian.enable = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
45
nix/configuration/roles/iso_mount/default.nix
Normal file
45
nix/configuration/roles/iso_mount/default.nix
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
iso_mount =
|
||||||
|
(pkgs.writeScriptBin "iso_mount" (builtins.readFile ./files/iso_mount.bash)).overrideAttrs
|
||||||
|
(old: {
|
||||||
|
buildCommand = "${old.buildCommand}\n patchShebangs $out";
|
||||||
|
|
||||||
|
});
|
||||||
|
iso_unmount =
|
||||||
|
(pkgs.writeScriptBin "iso_unmount" (builtins.readFile ./files/iso_unmount.bash)).overrideAttrs
|
||||||
|
(old: {
|
||||||
|
buildCommand = "${old.buildCommand}\n patchShebangs $out";
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
iso_mount.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to install iso_mount.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.me.iso_mount.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
{
|
||||||
|
environment.systemPackages = [
|
||||||
|
iso_mount
|
||||||
|
iso_unmount
|
||||||
|
];
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
8
nix/configuration/roles/iso_mount/files/iso_mount.bash
Normal file
8
nix/configuration/roles/iso_mount/files/iso_mount.bash
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Mount a full-disk image as a loopback device so you can mount individual partitions from inside of it.
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
exec udisksctl loop-setup -r -f "${@}"
|
8
nix/configuration/roles/iso_mount/files/iso_unmount.bash
Normal file
8
nix/configuration/roles/iso_mount/files/iso_unmount.bash
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Mount a full-disk image as a loopback device so you can mount individual partitions from inside of it.
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
exec udisksctl loop-delete "${@}"
|
170
nix/configuration/roles/rpcs3/default.nix
Normal file
170
nix/configuration/roles/rpcs3/default.nix
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
rpcs3_config_yaml = settingsFormat.generate "config.yml" config.me.rpcs3.config;
|
||||||
|
settingsFormat = pkgs.formats.yaml { };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
options.me = {
|
||||||
|
rpcs3.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether we want to install rpcs3.";
|
||||||
|
};
|
||||||
|
|
||||||
|
rpcs3.config = lib.mkOption rec {
|
||||||
|
apply = lib.recursiveUpdate default;
|
||||||
|
inherit (settingsFormat) type;
|
||||||
|
default = {
|
||||||
|
Core = {
|
||||||
|
"Use LLVM CPU" = lib.mkIf (config.me.optimizations.enable) config.me.optimizations.arch;
|
||||||
|
};
|
||||||
|
VFS = {
|
||||||
|
"Enable /host_root/" = false;
|
||||||
|
};
|
||||||
|
Video = {
|
||||||
|
"Write Color Buffers" = true;
|
||||||
|
VSync = true;
|
||||||
|
"Performance Overlay" = {
|
||||||
|
Enabled = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
Miscellaneous = {
|
||||||
|
"Pause emulation on RPCS3 focus loss" = true;
|
||||||
|
"Start games in fullscreen mode" = true;
|
||||||
|
"Pause Emulation During Home Menu" = false; # true makes the home menu slow
|
||||||
|
};
|
||||||
|
};
|
||||||
|
example = null;
|
||||||
|
description = "RPCS3's config.yml in nix form.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.me.rpcs3.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
(lib.mkIf config.me.graphical {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
rpcs3
|
||||||
|
];
|
||||||
|
|
||||||
|
security.pam.loginLimits = [
|
||||||
|
{
|
||||||
|
domain = "@wheel";
|
||||||
|
item = "memlock";
|
||||||
|
type = "hard";
|
||||||
|
value = "unlimited";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
domain = "@wheel";
|
||||||
|
item = "memlock";
|
||||||
|
type = "soft";
|
||||||
|
value = "unlimited";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
home-manager.users.talexander =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
home.file.".config/rpcs3/config.yml" = lib.mkIf (config.me.rpcs3.config != null) {
|
||||||
|
source = rpcs3_config_yaml;
|
||||||
|
};
|
||||||
|
home.file.".config/rpcs3/GuiConfigs/CurrentSettings.ini" = {
|
||||||
|
source = ./files/CurrentSettings.ini;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
||||||
|
hideMounts = true;
|
||||||
|
users.talexander = {
|
||||||
|
directories = [
|
||||||
|
{
|
||||||
|
# Location of ROMs.
|
||||||
|
directory = ".config/rpcs3/games";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0755";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
directory = ".config/rpcs3/dev_hdd0";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0755";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
directory = ".config/rpcs3/dev_hdd1";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0755";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
directory = ".config/rpcs3/savestates";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0755";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
directory = ".config/rpcs3/dev_usb000";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0755";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# Seems to be where the firmware is installed.
|
||||||
|
directory = ".config/rpcs3/dev_flash";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0755";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# Controller config.
|
||||||
|
directory = ".config/rpcs3/input_configs";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0755";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# Game icons.
|
||||||
|
directory = ".config/rpcs3/Icons";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0755";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
files = [
|
||||||
|
{
|
||||||
|
# play times and recently played
|
||||||
|
file = ".config/rpcs3/GuiConfigs/persistent_settings.dat";
|
||||||
|
parentDirectory = {
|
||||||
|
mode = "0755";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) {
|
||||||
|
hideMounts = true;
|
||||||
|
users.talexander = {
|
||||||
|
directories = [
|
||||||
|
{
|
||||||
|
# Game saves
|
||||||
|
directory = ".cache/rpcs3";
|
||||||
|
user = "talexander";
|
||||||
|
group = "talexander";
|
||||||
|
mode = "0755";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
5
nix/configuration/roles/rpcs3/files/CurrentSettings.ini
Normal file
5
nix/configuration/roles/rpcs3/files/CurrentSettings.ini
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[Meta]
|
||||||
|
currentStylesheet=Darker Style by TheMitoSan
|
||||||
|
|
||||||
|
[main_window]
|
||||||
|
infoBoxEnabledWelcome=false
|
@ -10,6 +10,9 @@ let
|
|||||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.libglvnd}/lib"
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.libglvnd}/lib"
|
||||||
exec ${pkgs.rpcs3}/bin/rpcs3 "''${@}"
|
exec ${pkgs.rpcs3}/bin/rpcs3 "''${@}"
|
||||||
'';
|
'';
|
||||||
|
rpcs3_config_yaml = settingsFormat.generate "config.yml" config.me.rpcs3.config;
|
||||||
|
settingsFormat = pkgs.formats.yaml { };
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ ];
|
imports = [ ];
|
||||||
@ -21,6 +24,33 @@ in
|
|||||||
example = true;
|
example = true;
|
||||||
description = "Whether we want to install rpcs3.";
|
description = "Whether we want to install rpcs3.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
rpcs3.config = lib.mkOption rec {
|
||||||
|
apply = lib.recursiveUpdate default;
|
||||||
|
inherit (settingsFormat) type;
|
||||||
|
default = {
|
||||||
|
Core = {
|
||||||
|
"Use LLVM CPU" = "znver2";
|
||||||
|
};
|
||||||
|
VFS = {
|
||||||
|
"Enable /host_root/" = false;
|
||||||
|
};
|
||||||
|
Video = {
|
||||||
|
"Write Color Buffers" = true;
|
||||||
|
VSync = true;
|
||||||
|
"Performance Overlay" = {
|
||||||
|
Enabled = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
Miscellaneous = {
|
||||||
|
"Pause emulation on RPCS3 focus loss" = true;
|
||||||
|
"Start games in fullscreen mode" = true;
|
||||||
|
"Pause Emulation During Home Menu" = false; # true makes the home menu slow
|
||||||
|
};
|
||||||
|
};
|
||||||
|
example = null;
|
||||||
|
description = "RPCS3's config.yml in nix form.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.me.rpcs3.enable (
|
config = lib.mkIf config.me.rpcs3.enable (
|
||||||
@ -31,15 +61,25 @@ in
|
|||||||
steam_rpcs3
|
steam_rpcs3
|
||||||
];
|
];
|
||||||
|
|
||||||
# .config/rpcs3/config.yml
|
home.file.".config/rpcs3/config.yml" = lib.mkIf (config.me.rpcs3.config != null) {
|
||||||
# .config/rpcs3/GuiConfigs/CurrentSettings.ini
|
source = rpcs3_config_yaml;
|
||||||
|
};
|
||||||
|
home.file.".config/rpcs3/GuiConfigs/CurrentSettings.ini" = {
|
||||||
|
source = ./files/CurrentSettings.ini;
|
||||||
|
};
|
||||||
|
|
||||||
me.persist.directories = [
|
me.persist.directories = [
|
||||||
|
".config/rpcs3/games" # Location of ROMs.
|
||||||
".config/rpcs3/dev_hdd0"
|
".config/rpcs3/dev_hdd0"
|
||||||
".config/rpcs3/dev_hdd1"
|
".config/rpcs3/dev_hdd1"
|
||||||
".config/rpcs3/savestates"
|
".config/rpcs3/savestates"
|
||||||
".config/rpcs3/dev_usb000"
|
".config/rpcs3/dev_usb000"
|
||||||
".config/rpcs3/dev_flash" # Seems to be where the firmware is installed.
|
".config/rpcs3/dev_flash" # Seems to be where the firmware is installed.
|
||||||
|
".config/rpcs3/input_configs" # Controller config.
|
||||||
|
".config/rpcs3/Icons" # Game icons.
|
||||||
|
];
|
||||||
|
me.persist.files = [
|
||||||
|
".config/rpcs3/GuiConfigs/persistent_settings.dat" # play times and recently played
|
||||||
];
|
];
|
||||||
me.state.directories = [ ".cache/rpcs3" ];
|
me.state.directories = [ ".cache/rpcs3" ];
|
||||||
|
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
[Meta]
|
||||||
|
currentStylesheet=Darker Style by TheMitoSan
|
||||||
|
|
||||||
|
[main_window]
|
||||||
|
infoBoxEnabledWelcome=false
|
@ -24,21 +24,12 @@ in
|
|||||||
config = lib.mkIf config.me.steam_rom_manager.enable (
|
config = lib.mkIf config.me.steam_rom_manager.enable (
|
||||||
lib.mkMerge [
|
lib.mkMerge [
|
||||||
(lib.mkIf config.me.graphical {
|
(lib.mkIf config.me.graphical {
|
||||||
home.packages = with pkgs; [
|
home.packages = [
|
||||||
package
|
package
|
||||||
];
|
];
|
||||||
|
|
||||||
me.persist.directories = [ ".config/steam-rom-manager/userData" ];
|
me.persist.directories = [ ".config/steam-rom-manager/userData" ];
|
||||||
|
|
||||||
home.persistence."/home/deck/.persist" = {
|
|
||||||
directories = [
|
|
||||||
{
|
|
||||||
directory = ".config/steam-rom-manager/userData";
|
|
||||||
method = "symlink";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# TODO: Install a fully configured /home/deck/.persist/.config/steam-rom-manager/userData/userConfigurations.json (which contains the parser definitions) and /home/deck/.persist/.config/steam-rom-manager/userData/userSettings.json (which contains the applications settings like steam directory).
|
# TODO: Install a fully configured /home/deck/.persist/.config/steam-rom-manager/userData/userConfigurations.json (which contains the parser definitions) and /home/deck/.persist/.config/steam-rom-manager/userData/userSettings.json (which contains the applications settings like steam directory).
|
||||||
# TODO: Maybe only persist /home/deck/.persist/.config/steam-rom-manager/userData/artworkBackups and /home/deck/.persist/.config/steam-rom-manager/userData/artworkCache.json after the parser config is being installed.
|
# TODO: Maybe only persist /home/deck/.persist/.config/steam-rom-manager/userData/artworkBackups and /home/deck/.persist/.config/steam-rom-manager/userData/artworkCache.json after the parser config is being installed.
|
||||||
|
|
||||||
|
@ -16,6 +16,12 @@
|
|||||||
example = [ ".local/share/dolphin-emu/Wii" ];
|
example = [ ".local/share/dolphin-emu/Wii" ];
|
||||||
description = "List of folders relative to the home directory to persist.";
|
description = "List of folders relative to the home directory to persist.";
|
||||||
};
|
};
|
||||||
|
persist.files = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
example = [ ".local/share/foo.sqlite3" ];
|
||||||
|
description = "List of files relative to the home directory to persist.";
|
||||||
|
};
|
||||||
state.directories = lib.mkOption {
|
state.directories = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
@ -50,6 +56,11 @@
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
(lib.mkIf (config.me.persist.files != [ ]) {
|
||||||
|
home.persistence."/home/deck/.persist" = {
|
||||||
|
files = config.me.persist.files;
|
||||||
|
};
|
||||||
|
})
|
||||||
(lib.mkIf (config.me.state.directories != [ ]) {
|
(lib.mkIf (config.me.state.directories != [ ]) {
|
||||||
home.persistence."/home/deck/.state" = {
|
home.persistence."/home/deck/.state" = {
|
||||||
directories = (
|
directories = (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user