init
This commit is contained in:
commit
2be8de47fa
87 changed files with 11501 additions and 0 deletions
39
modules/system/sched-ext.nix
Normal file
39
modules/system/sched-ext.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.myModules.sched-ext;
|
||||
in
|
||||
{
|
||||
options.myModules.sched-ext = {
|
||||
enable = lib.mkEnableOption "sched-ext (scx) schedulers";
|
||||
|
||||
scheduler = lib.mkOption {
|
||||
type = lib.types.enum [ "scx_rustland" "scx_lavd" "scx_rusty" "scx_bpfland" ];
|
||||
default = "scx_lavd";
|
||||
description = "The scx scheduler to run.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Install the schedulers
|
||||
environment.systemPackages = [ pkgs.scx ];
|
||||
|
||||
# Systemd service to run the scheduler
|
||||
systemd.services.scx = {
|
||||
description = "sched-ext scheduler (${cfg.scheduler})";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
path = [ pkgs.scx ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.scx}/bin/${cfg.scheduler}";
|
||||
Restart = "always";
|
||||
RestartSec = "3";
|
||||
Nice = -20;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue