aboutsummaryrefslogtreecommitdiffstats
path: root/modules/system/systemctl-tui/default.nix
blob: 7483db6da7c3f22b1066543562218e500103b31a (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
# TUI for systemctl
{
  config,
  pkgs,
  lib,
  ...
}:
{
  options.system.systemctl-tui = {
    enable = lib.mkEnableOption "Enables systemctl-tui.";
    package = lib.mkOption {
      type = lib.types.package;
      readOnly = true;
      default = pkgs.systemctl-tui;
      description = "The systemctl-tui package to use.";
    };
  };

  config = lib.mkIf config.system.systemctl-tui.enable {
    home.file.".local/share/icons/hicolor/scalable/apps/systemd.svg" = {
      source = ../../../assets/icons/apps/systemd.svg;
    };

    xdg.desktopEntries."systemctl-tui" = {
      name = "systemctl-tui";
      exec = "${lib.getExe config.terminal.kitty.package} --class systemctl-tui -e ${lib.getExe config.system.systemctl-tui.package}";
      icon = "systemd";
      categories = [ "System" ];
      comment = "TUI for systemctl";
      terminal = false;
      type = "Application";
    };

    home.packages = [ config.system.systemctl-tui.package ];
  };
}