aboutsummaryrefslogtreecommitdiffstats
path: root/modules/web/chromium/extensions/default.nix
blob: 49290c4e880b0fcc5ce6e12c5de39faeefabea39 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
  lib,
  pkgs,
  config,
  ...
}:
let
  extLib = import ./lib.nix {
    inherit lib pkgs config;
  };

  extensionSubmodule = lib.types.submodule {
    options = {
      pname = lib.mkOption {
        type = lib.types.str;
        description = "Package name of the extension.";
      };
      version = lib.mkOption {
        type = lib.types.str;
        description = "Resolved/pinned version of the extension.";
      };
      id = lib.mkOption {
        type = lib.types.nullOr lib.types.str;
        description = "Chrome extension ID, derived from the pinned key. Null if the extension isn't key-pinned.";
      };
      drv = lib.mkOption {
        type = lib.types.package;
        description = "Unpacked extension derivation.";
      };
    };
  };
in
{
  imports = [
    ./assertions.nix
  ];

  options.web.chromium.extensions = lib.mkOption {
    type = lib.types.attrsOf extensionSubmodule;
    internal = true;
    default = { };
    description = ''
      Resolved chromium extension derivations, keyed by name. Computed
      internally from ./extensions/*.nix — not user-settable. Read from
      other modules via e.g. `config.web.chromium.extensions.browserpass.id`.
    '';
  };

  config.web.chromium.extensions = {
    aria2Explorer = import ./aria2-explorer { inherit lib pkgs extLib; };
    browserpass = import ./browserpass { inherit lib pkgs extLib; };
    darkreader = import ./darkreader { inherit lib pkgs extLib; };
    searxngHome = import ./searxng-home { inherit lib pkgs extLib; };
    ublockOrigin = import ./ublock-origin { inherit lib pkgs extLib; };
    vimium = import ./vimium { inherit lib pkgs extLib; };
  };
}