Add ares for snes and nintendo 64.
This commit is contained in:
95
nix/steam_deck/configuration/roles/ares/default.nix
Normal file
95
nix/steam_deck/configuration/roles/ares/default.nix
Normal file
@@ -0,0 +1,95 @@
|
||||
# MANUAL: mkdir -p ~/.persist/.local/share/ares/saves ~/.persist/.local/share/ares/screenshots
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
steam_ares = pkgs.writeScriptBin "steam_ares" ''
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.libglvnd}/lib"
|
||||
exec ${pkgs.ares}/bin/ares "''${@}"
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
ares.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install ares.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.ares.enable (
|
||||
lib.mkMerge [
|
||||
(lib.mkIf config.me.graphical {
|
||||
nixGL.vulkan.enable = true;
|
||||
|
||||
home.packages = with pkgs; [
|
||||
ares
|
||||
steam_ares
|
||||
];
|
||||
|
||||
home.persistence."/home/deck/.persist" = {
|
||||
directories = [
|
||||
{
|
||||
directory = ".local/share/ares/saves";
|
||||
method = "symlink";
|
||||
}
|
||||
{
|
||||
directory = ".local/share/ares/screenshots";
|
||||
method = "symlink";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
home.file.".local/share/ares/settings.bml" = {
|
||||
source = ./files/settings.bml;
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(
|
||||
final: prev:
|
||||
let
|
||||
optimizeWithFlags =
|
||||
pkg: flags:
|
||||
pkg.overrideAttrs (old: {
|
||||
env.NIX_CFLAGS_COMPILE =
|
||||
(old.env.NIX_CFLAGS_COMPILE or "") + (lib.strings.concatStringsSep " " flags);
|
||||
});
|
||||
original_package =
|
||||
if config.me.optimizations.enable then
|
||||
(optimizeWithFlags prev.ares [
|
||||
"-march=znver2"
|
||||
"-mtune=znver2"
|
||||
])
|
||||
else
|
||||
prev.ares;
|
||||
in
|
||||
{
|
||||
ares = pkgs.buildEnv {
|
||||
name = prev.ares.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/ares.desktop
|
||||
'';
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user