aboutsummaryrefslogtreecommitdiffstats
path: root/modules/networking/bluetui/default.nix
blob: 782b653c64d6c5cf52cf852164e253de276b1509 (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
30
31
32
33
34
35
36
37
38
39
40
41
# Bluetooth TUI client
{
  config,
  lib,
  pkgs,
  ...
}:
let
  cfg = config.networking.bluetui;
  icons = config.desktop.icons.apps;
in
{
  imports = [
    ./assertions.nix
  ];

  options.networking.bluetui = {
    enable = lib.mkEnableOption "Enables bluetui.";
    package = lib.mkOption {
      type = lib.types.package;
      readOnly = true;
      default = pkgs.bluetui;
      description = "The bluetui package to use.";
    };
  };

  config = lib.mkIf cfg.enable {
    xdg.desktopEntries."bluetui" = {
      name = "bluetui";
      exec = "${lib.getExe config.terminal.kitty.package} -e ${lib.getExe cfg.package}";
      icon = icons.bluetui;
      categories = [ "Network" ];
      comment = "Bluetooth TUI client";
      terminal = false;
      type = "Application";
    };
    home.packages = [
      cfg.package
    ];
  };
}