about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/services/hardware/bolt.nix
blob: 3bdf67cc17581c9fd00de7a1162269884b55f4f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ config, lib, pkgs, ...}:

with lib;

let
  cfg = config.services.hardware.bolt;
in
{
  options = {
    services.hardware.bolt = {
      enable = mkOption {
        type = types.bool;
        default = false;
        description = lib.mdDoc ''
          Whether to enable Bolt, a userspace daemon to enable
          security levels for Thunderbolt 3 on GNU/Linux.

          Bolt is used by GNOME 3 to handle Thunderbolt settings.
        '';
      };

      package = mkPackageOption pkgs "bolt" { };
    };
  };

  config = mkIf cfg.enable {
    environment.systemPackages = [ cfg.package ];
    services.udev.packages = [ cfg.package ];
    systemd.packages = [ cfg.package ];
  };
}