1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-25 02:26:19 +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.

51 lines
1.1 KiB
Nix
Raw Normal View History

2022-09-16 19:23:46 +02:00
{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.supergfxd;
2022-12-08 11:46:10 +03:00
json = pkgs.formats.json { };
2022-09-16 19:23:46 +02:00
in
{
options = {
services.supergfxd = {
enable = lib.mkEnableOption "the supergfxd service";
2022-09-16 19:23:46 +02:00
settings = lib.mkOption {
2022-12-08 11:46:10 +03:00
type = lib.types.nullOr json.type;
2022-09-16 19:23:46 +02:00
default = null;
description = ''
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 19:23:46 +02: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 19:23:46 +02:00
services.dbus.packages = [ pkgs.supergfxctl ];
services.udev.packages = [ pkgs.supergfxctl ];
};
meta.maintainers = pkgs.supergfxctl.meta.maintainers;
}