nixpkgs/nixos/modules/services/hardware/supergfxd.nix

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

43 lines
1.1 KiB
Nix
Raw Normal View History

2022-09-16 17:23:46 +00:00
{ config, lib, pkgs, ... }:
let
cfg = config.services.supergfxd;
2022-12-08 08:46:10 +00:00
json = pkgs.formats.json { };
2022-09-16 17:23:46 +00:00
in
{
options = {
services.supergfxd = {
enable = lib.mkEnableOption (lib.mdDoc "the supergfxd service");
2022-09-16 17:23:46 +00:00
settings = lib.mkOption {
2022-12-08 08:46:10 +00:00
type = lib.types.nullOr json.type;
2022-09-16 17:23:46 +00:00
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) {
source = json.generate "supergfxd.conf" cfg.settings;
mode = "0644";
};
2022-09-16 17:23:46 +00:00
services.dbus.enable = true;
systemd.packages = [ pkgs.supergfxctl ];
systemd.services.supergfxd.wantedBy = [ "multi-user.target" ];
systemd.services.supergfxd.path = [ pkgs.kmod pkgs.pciutils ];
2022-09-16 17:23:46 +00:00
services.dbus.packages = [ pkgs.supergfxctl ];
services.udev.packages = [ pkgs.supergfxctl ];
};
meta.maintainers = pkgs.supergfxctl.meta.maintainers;
}