diff --git a/hosts/Infini-FRAMEWORK/default.nix b/hosts/Infini-FRAMEWORK/default.nix index a9d6d02..a598523 100644 --- a/hosts/Infini-FRAMEWORK/default.nix +++ b/hosts/Infini-FRAMEWORK/default.nix @@ -55,4 +55,12 @@ networking.interfaces.wlp170s0.useDHCP = true; console.font = lib.mkDefault "${pkgs.terminus_font}/share/consolefonts/ter-v32n.psf.gz"; + + systemd.services.set-initial-backlight = { + description = "Sets the initial backlight state on startup"; + wantedBy = [ "sys-devices-pci0000:00-0000:00:02.0-drm-card0-card0\\x2deDP\\x2d1-intel_backlight.device" ]; + after = [ "system-systemd\\x2dbacklight.slice" "systemd-backlight@backlight:intel_backlight.service" ]; + serviceConfig.Type = "oneshot"; + script = "${lib.our.getMainProgram pkgs.acpilight} -set 50"; + }; } diff --git a/modules/modules/hardware/backlight.nix b/modules/modules/hardware/backlight.nix deleted file mode 100644 index ada9ac4..0000000 --- a/modules/modules/hardware/backlight.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ config, lib, pkgs, inputs, ... }: -with lib; -with lib.our; -with lib.hlissner; -let - cfg = config.modules.hardware.backlight; -in -{ - options.modules.hardware.backlight = with types; { - enable = mkBoolOpt false; - initialValue = mkOpt str "50"; - initialCommand = mkOpt str "${getMainProgram pkgs.acpilight} -set ${cfg.initialValue}"; - }; - - config = mkIf cfg.enable { - systemd.services = { - "set-initial-backlight" = { - description = "Sets the initial backlight status on startup"; - after = [ "multi-user.target" ]; - serviceConfig.Type = "oneshot"; - script = cfg.initialCommand; - }; - }; - boot.kernelParams = [ "systemd.restore_state=0" ]; - }; -} diff --git a/modules/modules/hardware/form.nix b/modules/modules/hardware/form.nix index 7e6b2de..67f8c49 100644 --- a/modules/modules/hardware/form.nix +++ b/modules/modules/hardware/form.nix @@ -21,7 +21,6 @@ in modules.hardware = { wireless.enable = mkDefault true; audio.enable = mkDefault true; - backlight.enable = mkDefault true; }; hardware = {