nixos/services.preload: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-30 00:46:42 +02:00
parent 257f608dfc
commit 6a73a0aca9

View File

@ -1,25 +1,22 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.preload;
in {
meta = { maintainers = pkgs.preload.meta.maintainers; };
options.services.preload = {
enable = mkEnableOption "preload";
package = mkPackageOption pkgs "preload" { };
enable = lib.mkEnableOption "preload";
package = lib.mkPackageOption pkgs "preload" { };
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
systemd.services.preload = {
description = "Loads data into ram during idle time of CPU.";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
EnvironmentFile = "${cfg.package}/etc/conf.d/preload";
ExecStart = "${getExe cfg.package} -l '' --foreground $PRELOAD_OPTS";
ExecStart = "${lib.getExe cfg.package} -l '' --foreground $PRELOAD_OPTS";
Type = "simple";
# Only preload data during CPU idle time
IOSchedulingClass = 3;