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

View File

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

View File

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