Compare commits
13 Commits
1866cf6290
...
install_fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
504f8ecf09 | ||
|
|
7254bc8c7c | ||
|
|
a32f6bf0d1 | ||
|
|
996cb27a89 | ||
|
|
9008d9b7c6 | ||
|
|
38a1168a32 | ||
|
|
3a4344a112 | ||
|
|
18cb758986 | ||
|
|
e28c7f8968 | ||
|
|
5c17148635 | ||
|
|
199bb38dfb | ||
|
|
5af4a95940 | ||
|
|
daf35778c5 |
@@ -32,6 +32,7 @@
|
||||
./roles/graphics
|
||||
./roles/hydra
|
||||
./roles/iso
|
||||
./roles/iso_mount
|
||||
./roles/kanshi
|
||||
./roles/kodi
|
||||
./roles/kubernetes
|
||||
@@ -49,6 +50,7 @@
|
||||
./roles/python
|
||||
./roles/qemu
|
||||
./roles/reset
|
||||
./roles/rpcs3
|
||||
./roles/rust
|
||||
./roles/shikane
|
||||
./roles/shipwright
|
||||
@@ -70,9 +72,14 @@
|
||||
./roles/zfs
|
||||
./roles/zrepl
|
||||
./roles/zsh
|
||||
./util/install_files
|
||||
./util/unfree_polyfill
|
||||
];
|
||||
|
||||
me.install.user.talexander.file."/home/talexander/flake.nix" = {
|
||||
source = ./flake.nix;
|
||||
};
|
||||
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
me.gpg.enable = true;
|
||||
me.graphical = true;
|
||||
me.graphics_card_type = "amd";
|
||||
me.iso_mount.enable = true;
|
||||
me.kanshi.enable = false;
|
||||
me.kubernetes.enable = true;
|
||||
me.latex.enable = true;
|
||||
@@ -85,6 +86,7 @@
|
||||
me.pcsx2.enable = true;
|
||||
me.python.enable = true;
|
||||
me.qemu.enable = true;
|
||||
me.rpcs3.enable = true;
|
||||
me.rust.enable = true;
|
||||
me.shikane.enable = true;
|
||||
me.sops.enable = true;
|
||||
|
||||
@@ -13,94 +13,101 @@
|
||||
./wifi.nix
|
||||
];
|
||||
|
||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||
networking.hostId = "47ee7d7c";
|
||||
config = {
|
||||
# Generate with `head -c4 /dev/urandom | od -A none -t x4`
|
||||
networking.hostId = "47ee7d7c";
|
||||
|
||||
networking.hostName = "quark"; # Define your hostname.
|
||||
networking.hostName = "quark"; # Define your hostname.
|
||||
|
||||
time.timeZone = "America/New_York";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
time.timeZone = "America/New_York";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
me.secureBoot.enable = true;
|
||||
me.secureBoot.enable = true;
|
||||
|
||||
me.optimizations = {
|
||||
enable = true;
|
||||
arch = "znver5";
|
||||
system_features = [
|
||||
"gccarch-znver4"
|
||||
"gccarch-znver5"
|
||||
"gccarch-skylake"
|
||||
# "gccarch-alderlake" missing WAITPKG
|
||||
"gccarch-x86-64-v3"
|
||||
"gccarch-x86-64-v4"
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
"kvm"
|
||||
"nixos-test"
|
||||
me.optimizations = {
|
||||
enable = true;
|
||||
arch = "znver5";
|
||||
system_features = [
|
||||
"gccarch-znver4"
|
||||
"gccarch-znver5"
|
||||
"gccarch-skylake"
|
||||
# "gccarch-alderlake" missing WAITPKG
|
||||
"gccarch-x86-64-v3"
|
||||
"gccarch-x86-64-v4"
|
||||
"benchmark"
|
||||
"big-parallel"
|
||||
"kvm"
|
||||
"nixos-test"
|
||||
];
|
||||
};
|
||||
|
||||
# Early KMS
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
|
||||
# Mount tmpfs at /tmp
|
||||
boot.tmp.useTmpfs = true;
|
||||
|
||||
# Enable TRIM
|
||||
# services.fstrim.enable = lib.mkDefault true;
|
||||
|
||||
# RPCS3 has difficulty with znver5
|
||||
me.rpcs3.config.Core."Use LLVM CPU" = "znver4";
|
||||
|
||||
me.alacritty.enable = true;
|
||||
me.ansible.enable = true;
|
||||
me.ares.enable = true;
|
||||
me.bluetooth.enable = true;
|
||||
me.chromecast.enable = true;
|
||||
me.chromium.enable = true;
|
||||
me.docker.enable = true;
|
||||
me.ecc.enable = true;
|
||||
me.emacs_flavor = "full";
|
||||
me.firefox.enable = true;
|
||||
me.flux.enable = true;
|
||||
me.gcloud.enable = true;
|
||||
me.git.config = ../../roles/git/files/gitconfig_home;
|
||||
me.gnuplot.enable = true;
|
||||
me.gpg.enable = true;
|
||||
me.graphical = true;
|
||||
me.graphics_card_type = "amd";
|
||||
me.iso_mount.enable = true;
|
||||
me.kanshi.enable = false;
|
||||
me.kubernetes.enable = true;
|
||||
me.latex.enable = true;
|
||||
me.launch_keyboard.enable = true;
|
||||
me.lvfs.enable = true;
|
||||
me.media.enable = true;
|
||||
me.nix_index.enable = true;
|
||||
me.nix_worker.enable = true;
|
||||
me.pcsx2.enable = true;
|
||||
me.python.enable = true;
|
||||
me.qemu.enable = true;
|
||||
me.rpcs3.enable = true;
|
||||
me.rust.enable = true;
|
||||
me.shikane.enable = true;
|
||||
me.sops.enable = true;
|
||||
me.sound.enable = true;
|
||||
me.steam.enable = true;
|
||||
me.steam_run_free.enable = true;
|
||||
me.sway.enable = true;
|
||||
me.tekton.enable = true;
|
||||
me.terraform.enable = true;
|
||||
me.thunderbolt.enable = true;
|
||||
me.vnc_client.enable = true;
|
||||
me.vscode.enable = true;
|
||||
me.wasm.enable = true;
|
||||
me.waybar.enable = true;
|
||||
me.wireguard.activated = [
|
||||
"drmario"
|
||||
"wgh"
|
||||
"colo"
|
||||
];
|
||||
me.wireguard.deactivated = [ "wgf" ];
|
||||
me.zrepl.enable = true;
|
||||
me.zsh.enable = true;
|
||||
|
||||
me.sm64ex.enable = true;
|
||||
me.shipwright.enable = true;
|
||||
me.ship2harkinian.enable = true;
|
||||
};
|
||||
|
||||
# Early KMS
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
|
||||
# Mount tmpfs at /tmp
|
||||
boot.tmp.useTmpfs = true;
|
||||
|
||||
# Enable TRIM
|
||||
# services.fstrim.enable = lib.mkDefault true;
|
||||
|
||||
me.alacritty.enable = true;
|
||||
me.ansible.enable = true;
|
||||
me.ares.enable = true;
|
||||
me.bluetooth.enable = true;
|
||||
me.chromecast.enable = true;
|
||||
me.chromium.enable = true;
|
||||
me.docker.enable = true;
|
||||
me.ecc.enable = true;
|
||||
me.emacs_flavor = "full";
|
||||
me.firefox.enable = true;
|
||||
me.flux.enable = true;
|
||||
me.gcloud.enable = true;
|
||||
me.git.config = ../../roles/git/files/gitconfig_home;
|
||||
me.gnuplot.enable = true;
|
||||
me.gpg.enable = true;
|
||||
me.graphical = true;
|
||||
me.graphics_card_type = "amd";
|
||||
me.kanshi.enable = false;
|
||||
me.kubernetes.enable = true;
|
||||
me.latex.enable = true;
|
||||
me.launch_keyboard.enable = true;
|
||||
me.lvfs.enable = true;
|
||||
me.media.enable = true;
|
||||
me.nix_index.enable = true;
|
||||
me.nix_worker.enable = true;
|
||||
me.pcsx2.enable = true;
|
||||
me.python.enable = true;
|
||||
me.qemu.enable = true;
|
||||
me.rust.enable = true;
|
||||
me.shikane.enable = true;
|
||||
me.sops.enable = true;
|
||||
me.sound.enable = true;
|
||||
me.steam.enable = true;
|
||||
me.steam_run_free.enable = true;
|
||||
me.sway.enable = true;
|
||||
me.tekton.enable = true;
|
||||
me.terraform.enable = true;
|
||||
me.thunderbolt.enable = true;
|
||||
me.vnc_client.enable = true;
|
||||
me.vscode.enable = true;
|
||||
me.wasm.enable = true;
|
||||
me.waybar.enable = true;
|
||||
me.wireguard.activated = [
|
||||
"drmario"
|
||||
"wgh"
|
||||
"colo"
|
||||
];
|
||||
me.wireguard.deactivated = [ "wgf" ];
|
||||
me.zrepl.enable = true;
|
||||
me.zsh.enable = true;
|
||||
|
||||
me.sm64ex.enable = true;
|
||||
me.shipwright.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
|
||||
179
nix/configuration/util/install_files/default.nix
Normal file
179
nix/configuration/util/install_files/default.nix
Normal file
@@ -0,0 +1,179 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
home-manager,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
attrNames
|
||||
filter
|
||||
flatten
|
||||
;
|
||||
makeFileOption =
|
||||
prefix:
|
||||
lib.mkOption {
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule (
|
||||
{ name, config, ... }:
|
||||
{
|
||||
options = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
defaultText = "${prefix}.‹path›.enable";
|
||||
example = false;
|
||||
description = "Whether we want to install this file.";
|
||||
};
|
||||
method = lib.mkOption {
|
||||
type = lib.types.enum [
|
||||
"symlink"
|
||||
"overwrite"
|
||||
"initialize"
|
||||
# "bind_mount" TODO: for directories?
|
||||
];
|
||||
default = "symlink";
|
||||
defaultText = "${prefix}.‹path›.method";
|
||||
example = "overwrite";
|
||||
description = "The way in which the file should be installed.";
|
||||
};
|
||||
mode = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "0444";
|
||||
defaultText = "${prefix}.‹path›.mode";
|
||||
example = "0750";
|
||||
description = "The read, write, execute permission flags.";
|
||||
};
|
||||
source = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
defaultText = "${prefix}.‹path›.source";
|
||||
example = ./files/foo.txt;
|
||||
description = "The source file to install into the destination.";
|
||||
};
|
||||
target = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
defaultText = "${prefix}.‹path›.target";
|
||||
example = ".local/share/foo/bar.txt";
|
||||
description = "The path where the file should be written.";
|
||||
};
|
||||
group = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
defaultText = "${prefix}.‹path›.group";
|
||||
example = ".local/share/foo/bar.txt";
|
||||
description = "The group that should own the file.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
target = lib.mkDefault name;
|
||||
};
|
||||
}
|
||||
)
|
||||
);
|
||||
defaultText = "${prefix}.‹path›";
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
".config/foo/bar.txt" = {
|
||||
source = ./files/bar.txt
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me.install = {
|
||||
user = lib.mkOption {
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule (
|
||||
{ name, config, ... }:
|
||||
{
|
||||
options = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
defaultText = "me.install.user.‹username›.enable";
|
||||
example = false;
|
||||
description = "Whether we want to install files in this user's home directory.";
|
||||
};
|
||||
target_username = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
defaultText = "me.install.file.‹username›.target_username";
|
||||
example = "root";
|
||||
description = "The username for the user whose home directory will contain the file.";
|
||||
};
|
||||
file = makeFileOption "me.install.user.‹username›.file";
|
||||
};
|
||||
|
||||
config = {
|
||||
target_username = lib.mkDefault name;
|
||||
};
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
defaultText = "me.install.user.‹username›";
|
||||
default = { };
|
||||
# TODO: example
|
||||
};
|
||||
# TODO: Global option owned by root?
|
||||
# file = makeFileOption "me.install.file";
|
||||
};
|
||||
|
||||
config =
|
||||
let
|
||||
cfg = config.me.install;
|
||||
active_install_users = filter (username: cfg.user."${username}".enable) (attrNames cfg.user);
|
||||
install_commands = flatten (
|
||||
builtins.map (
|
||||
username:
|
||||
let
|
||||
active_install_file_targets = filter (target: cfg.user."${username}".file."${target}".enable) (
|
||||
attrNames cfg.user."${username}".file
|
||||
);
|
||||
in
|
||||
builtins.map (
|
||||
target:
|
||||
let
|
||||
target_config = cfg.user."${username}".file."${target}";
|
||||
source = lib.strings.escapeShellArg "${target_config.source}";
|
||||
destination = lib.strings.escapeShellArg "${target_config.target}";
|
||||
mode = lib.strings.escapeShellArg "${target_config.mode}";
|
||||
escaped_username = lib.strings.escapeShellArg "${username}";
|
||||
escaped_group =
|
||||
if target_config.group == null then
|
||||
"$(id -g ${escaped_username})"
|
||||
else
|
||||
(lib.strings.escapeShellArg "${target_config.group}");
|
||||
in
|
||||
''
|
||||
$DRY_RUN_CMD install $VERBOSE_ARG -D --compare -o ${escaped_username} -g ${escaped_group} -m ${mode} ${source} ${destination}
|
||||
''
|
||||
) active_install_file_targets
|
||||
) active_install_users
|
||||
);
|
||||
|
||||
in
|
||||
lib.mkMerge [
|
||||
(lib.mkIf (install_commands != [ ]) ({
|
||||
systemd.services.me-install-file = {
|
||||
enable = true;
|
||||
description = "me-install-file";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "multi-user.target" ];
|
||||
after = [ "multi-user.target" ];
|
||||
unitConfig.DefaultDependencies = "no";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = "yes";
|
||||
};
|
||||
script = (lib.strings.concatStringsSep "\n" install_commands);
|
||||
};
|
||||
}))
|
||||
];
|
||||
}
|
||||
@@ -10,6 +10,9 @@ let
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.libglvnd}/lib"
|
||||
exec ${pkgs.rpcs3}/bin/rpcs3 "''${@}"
|
||||
'';
|
||||
rpcs3_config_yaml = settingsFormat.generate "config.yml" config.me.rpcs3.config;
|
||||
settingsFormat = pkgs.formats.yaml { };
|
||||
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
@@ -21,6 +24,33 @@ in
|
||||
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" = "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 (
|
||||
@@ -31,15 +61,25 @@ in
|
||||
steam_rpcs3
|
||||
];
|
||||
|
||||
# .config/rpcs3/config.yml
|
||||
# .config/rpcs3/GuiConfigs/CurrentSettings.ini
|
||||
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;
|
||||
};
|
||||
|
||||
me.persist.directories = [
|
||||
".config/rpcs3/games" # Location of ROMs.
|
||||
".config/rpcs3/dev_hdd0"
|
||||
".config/rpcs3/dev_hdd1"
|
||||
".config/rpcs3/savestates"
|
||||
".config/rpcs3/dev_usb000"
|
||||
".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" ];
|
||||
|
||||
|
||||
@@ -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 (
|
||||
lib.mkMerge [
|
||||
(lib.mkIf config.me.graphical {
|
||||
home.packages = with pkgs; [
|
||||
home.packages = [
|
||||
package
|
||||
];
|
||||
|
||||
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: 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" ];
|
||||
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 {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
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 != [ ]) {
|
||||
home.persistence."/home/deck/.state" = {
|
||||
directories = (
|
||||
|
||||
Reference in New Issue
Block a user