miku: Fix gajim and gamemode

This commit is contained in:
PapaTutuWawa 2021-08-23 20:28:54 +02:00
parent 25b4dcac69
commit 6cd0324cbf

View File

@ -27,27 +27,43 @@ in {
#}))
# Steam overlay
(final: prev:
let
# NOTE: This is a really messy solution
buildFHSUserEnvBubblewrap = prev.callPackage ../packages/build-support/build-fhs-userenv-bubblewrap {};
in {
steamPackages = prev.steamPackages.override {
buildFHSUserEnv = buildFHSUserEnvBubblewrap;
# Include gamemode in the FHS
#extraPkgs = (pkgs: with pkgs; [ gamemode ]);
};
# TODO: Replace with the commented out version below
(final: prev: let
buildFHSUserEnvBubblewrap = prev.callPackage ../packages/build-support/build-fhs-userenv-bubblewrap {};
steamPackages = lib.dontRecurseIntoAttrs (prev.callPackage ../packages/games/steam {
buildFHSUserEnv = buildFHSUserEnvBubblewrap;
});
in {
buildFHSUserEnvBubblewrap = buildFHSUserEnvBubblewrap;
steamPackages = steamPackages;
steam = steamPackages.steam-fhsenv.override {
extraPkgs = pkgs: with pkgs; [ gamemode ];
};
})
#(final: prev:
# let
# # NOTE: This is a really messy solution
# buildFHSUserEnvBubblewrap = prev.callPackage ../packages/build-support/build-fhs-userenv-bubblewrap {};
# in {
# steamPackages = prev.steamPackages.override {
# buildFHSUserEnv = buildFHSUserEnvBubblewrap;
# # Include gamemode in the FHS
# #extraPkgs = (pkgs: with pkgs; [ gamemode ]);
# };
steam = final.steamPackages.steam-fhsenv.overrideAttrs (old: {
specifyHomeDirs = true;
chdirTo = "/home/$USER";
});
steam-run = final.steam.run;
steam-run-native = (final.steam.override {
nativeOnly = true;
});
steamcmd = final.steamPackages.steamcmd;
})
# steam = prev.steamPackages.steam-fhsenv.overrideAttrs (old: {
# specifyHomeDirs = true;
# chdirTo = "/home/$USER";
# });
# #steam = final.steamPackages.steam-fhsenv.override {
# # extraPkgs = pkgs: with pkgs; [ gamemode ];
# #};
# steam-run = final.steam.run;
# steam-run-native = (final.steam.override {
# nativeOnly = true;
# });
# steamcmd = final.steamPackages.steamcmd;
# })
# Simple overrides
(final: prev: {
@ -57,6 +73,11 @@ in {
"--set" "DRI_PRIME" "1"
];
};
gajim = prev.gajim.overrideAttrs (old: {
# Enable notification sounds
propagatedBuildInputs = old.propagatedBuildInputs ++ [ prev.gsound ];
});
})
customPkgs
@ -66,6 +87,23 @@ in {
unstable = unstable;
nur = (import ../modules/nur.nix pkgs);
};
security = {
pam.loginLimits = [
{
domain = "@gamemode";
item = "-";
type = "nice";
value = "-10";
}
];
wrappers = {
gamemoded = {
source = "${pkgs.gamemode}/bin/gamemoded";
capabilities = "cap_sys_nice+ep";
};
};
};
environment = {
systemPackages = with pkgs; [
@ -298,12 +336,20 @@ in {
Restart = "always";
};
};
# TODO: Remove once in stable or I decide to use unstable
gamemode = {
description = "A daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS.";
wantedBy = [ "default.target" ];
environment.PATH = lib.mkForce (pkgs.linkFarm "pkexec" [
{
name = "pkexec";
path = "${config.security.wrapperDir}/pkexec";
}
]);
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.gamemode}/bin/gamemoded";
#ExecStart = "${pkgs.gamemode}/bin/gamemoded";
ExecStart = "${config.security.wrapperDir}/gamemoded";
Restart = "always";
};
};