Install shadps4.
This commit is contained in:
112
nix/configuration/roles/shadps4/default.nix
Normal file
112
nix/configuration/roles/shadps4/default.nix
Normal file
@@ -0,0 +1,112 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
shadps4.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install shadps4.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.shadps4.enable (
|
||||
lib.mkMerge [
|
||||
(lib.mkIf config.me.graphical {
|
||||
environment.systemPackages = with pkgs; [
|
||||
shadps4
|
||||
];
|
||||
|
||||
home-manager.users.talexander =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.file.".local/share/shadPS4/config.toml" = {
|
||||
source = ./files/config.toml;
|
||||
};
|
||||
};
|
||||
|
||||
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
||||
hideMounts = true;
|
||||
users.talexander = {
|
||||
directories = [
|
||||
{
|
||||
# Location of ROMs.
|
||||
directory = ".local/share/shadPS4/games";
|
||||
user = "talexander";
|
||||
group = "talexander";
|
||||
mode = "0755";
|
||||
}
|
||||
{
|
||||
# Firmware.
|
||||
directory = ".local/share/shadPS4/sys_modules";
|
||||
user = "talexander";
|
||||
group = "talexander";
|
||||
mode = "0755";
|
||||
}
|
||||
{
|
||||
# Game saves.
|
||||
directory = ".local/share/shadPS4/savedata";
|
||||
user = "talexander";
|
||||
group = "talexander";
|
||||
mode = "0755";
|
||||
}
|
||||
{
|
||||
# DLC.
|
||||
directory = ".local/share/shadPS4/addcont";
|
||||
user = "talexander";
|
||||
group = "talexander";
|
||||
mode = "0755";
|
||||
}
|
||||
];
|
||||
files = [
|
||||
{
|
||||
# play times and recently played
|
||||
file = ".local/share/shadPS4/play_time.txt";
|
||||
parentDirectory = {
|
||||
mode = "0755";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
environment.persistence."/state" = lib.mkIf (!config.me.buildingIso) {
|
||||
hideMounts = true;
|
||||
users.talexander = {
|
||||
directories = [
|
||||
{
|
||||
# Cache.
|
||||
directory = ".local/share/shadPS4/data";
|
||||
user = "talexander";
|
||||
group = "talexander";
|
||||
mode = "0755";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
shadps4 = prev.shadps4.overrideAttrs (old: {
|
||||
version = "0.9.0";
|
||||
src = final.fetchFromGitHub {
|
||||
owner = "AzaharPlus";
|
||||
repo = "shadPS4Plus";
|
||||
tag = "SHADPS4PLUS_0_9_0_A";
|
||||
hash = "sha256-ZwP+bOE4roWt51Ii53blDZzdq/SxK4Q69I4rLCNARLA=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
});
|
||||
})
|
||||
];
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
4
nix/configuration/roles/shadps4/files/config.toml
Normal file
4
nix/configuration/roles/shadps4/files/config.toml
Normal file
@@ -0,0 +1,4 @@
|
||||
[GUI]
|
||||
addonInstallDir = "/home/talexander/.local/share/shadPS4/addcont"
|
||||
installDirs = ["/home/talexander/.local/share/shadPS4/games"]
|
||||
installDirsEnabled = [true]
|
||||
Reference in New Issue
Block a user