Skip to content

Commit

Permalink
modules/steamos: add earlyoom
Browse files Browse the repository at this point in the history
  • Loading branch information
K900 committed Nov 26, 2024
1 parent 3bb5c3c commit 39395c7
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/steamos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ in
./automount.nix
./bluetooth.nix
./boot.nix
./earlyoom.nix
./mesa.nix
./misc.nix
./sysctl.nix
Expand Down
28 changes: 28 additions & 0 deletions modules/steamos/earlyoom.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ config, lib, ... }:

let
inherit (lib)
mkIf
mkOption
types
;
cfg = config.jovian.steamos;
in
{
options.jovian.steamos.enableEarlyOOM = mkOption {
default = cfg.useSteamOSConfig;
defaultText = lib.literalExpression "config.jovian.steamos.useSteamOSConfig";
type = types.bool;
description = ''
Enable SteamOS-like earlyoom config.
'';
};

config = mkIf (cfg.enableEarlyOOM) {
# Match vendor settings: https://github.com/Jovian-Experiments/PKGBUILDs-mirror/blob/holo-main/holo-earlyoom/holo-earlyoom.systemd.conf
services.earlyoom = {
enable = lib.mkDefault true;
extraArgs = lib.mkDefault [ "-M" "409600,307200" "-S" "409600,307200" ];
};
};
}
2 changes: 2 additions & 0 deletions support/manifest/mappings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ grub.ignore = true
# we use nixos config
holo-dmi-rules.check = "1.0-2"

holo-earlyoom.check = "1.0-1"

# unused, check in case it ever becomes used again
holo-fstab-repair.check = "0.1-1"

Expand Down

0 comments on commit 39395c7

Please sign in to comment.