1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-06 18:49:12 +03:00
nixpkgs/nixos/modules/services/hardware/supergfxd.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
1 KiB
Nix
Raw Normal View History

2022-09-16 19:23:46 +02:00
{ config, lib, pkgs, ... }:
let
cfg = config.services.supergfxd;
ini = pkgs.formats.ini { };
in
{
options = {
services.supergfxd = {
enable = lib.mkEnableOption (lib.mdDoc "Enable the supergfxd service");
settings = lib.mkOption {
type = lib.types.nullOr ini.type;
default = null;
description = lib.mdDoc ''
The content of /etc/supergfxd.conf.
See https://gitlab.com/asus-linux/supergfxctl/#config-options-etcsupergfxdconf.
'';
};
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ pkgs.supergfxctl ];
environment.etc."supergfxd.conf" = lib.mkIf (cfg.settings != null) (ini.generate "supergfxd.conf" cfg.settings);
services.dbus.enable = true;
systemd.packages = [ pkgs.supergfxctl ];
systemd.services.supergfxd.wantedBy = [ "multi-user.target" ];
services.dbus.packages = [ pkgs.supergfxctl ];
services.udev.packages = [ pkgs.supergfxctl ];
};
meta.maintainers = pkgs.supergfxctl.meta.maintainers;
}