summaryrefslogtreecommitdiffstats
path: root/nixos/modules/hardware/glasgow.nix
blob: 8e478e5437d9b7e98e8e31a08ad7b7117cfb0cd9 (plain)
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
{
  config,
  lib,
  pkgs,
  ...
}:

let
  cfg = config.hardware.glasgow;

in
{
  options.hardware.glasgow = {
    enable = lib.mkOption {
      type = lib.types.bool;
      default = false;
      description = ''
        Enables Glasgow udev rules and ensures 'plugdev' group exists.
        This is a prerequisite to using Glasgow without being root.
      '';
    };
  };

  config = lib.mkIf cfg.enable {
    environment.systemPackages = [ pkgs.glasgow ];
    services.udev.packages = [ pkgs.glasgow ];
    users.groups.plugdev = { };
  };
}