host: Enable earlyoom

This commit is contained in:
PapaTutuWawa 2021-09-20 11:40:49 +02:00
parent deb88dafa7
commit c147db7c59
3 changed files with 25 additions and 5 deletions

View File

@ -44,6 +44,7 @@ in mkHost config {
piper
anime-dl trackma
unstable.thunderbird
multimc-wrapped
];
extraOptions = old: {
programs = {
@ -51,10 +52,6 @@ in mkHost config {
adb.enable = true;
};
# TODO: Move to virtualisation/gaming.nix
# Allow scream to connect to this host
networking.firewall.allowedUDPPorts = [ 4010 ];
boot = {
extraModprobeConfig = ''
options kvm_amd nested=1
@ -91,6 +88,7 @@ in mkHost config {
connman.extraConfig = ''
WriteResolvConf=false
'';
udev.packages = with pkgs; [ key-mapper ];
};
security = {

View File

@ -175,6 +175,12 @@ let
# For debugging.
# TODO: Lock to known IPs and keys
sshd.enable = true;
# Prevent unexpected OOM situations with heavy swapping
earlyoom = {
enable = true;
enableNotifications = true;
};
};
# Don't wait for a network connection

View File

@ -8,6 +8,8 @@ let
# Wayland
# NOTE: electron under Wayland has no window titlebars
#extraStartupArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland";
#extraStartupArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=WebRTCPipeWireCapturer";
#extraStartupArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=WebRTCPipeWireCapturer";
};
wrapInSandbox = pkgs.callPackage ./sandbox.nix {};
in {
@ -39,7 +41,7 @@ in {
name = "discord";
package = discord-system-electron;
binaryName = "discord";
mountInHome = [ ".config/discord" ];
mountInHome = [ ".config/discord" ".config/BetterDiscord" ];
additionalBlacklist = [ "/mnt" ];
chdirTo = "/home/$USER";
@ -55,11 +57,25 @@ in {
};
};
sddm-sugar-dark = pkgs.callPackage ./sddm-sugar-dark {};
iptsd = pkgs.callPackage ./tools/daemons/iptsd {};
surface-control = pkgs.callPackage ./tools/system/surface-control {};
trackma = pkgs.callPackage ./tools/video/trackma {};
multimc-wrapped = wrapInSandbox {
name = "multimc";
package = pkgs.multimc;
binaryName = "multimc";
mountInHome = [ ".local/share/multimc" ];
additionalBlacklist = [ "/mnt" ];
chdirTo = "/home/$USER";
extraEnv = {
DRI_PRIME = "1";
};
};
steam-wrapped = wrapInSandbox {
name = "steam";
package = pkgs.steam;