about summary refs log tree commit diff
path: root/pkgs/games/itch/default.nix
blob: cae4b99f16833127617ebd900da1919d95563ddd (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
{ config, lib, pkgs, ... }:

let
  cfg = config.itch;

  self = rec {
    callPackage = pkgs.lib.callPackageWith (pkgs // self);
    callPackage_i686 = pkgs.lib.callPackageWith (pkgs.pkgsi686Linux // self);

    fetchItch = callPackage ./fetch-itch {
      inherit (config.itch) apiKey;
    };

    invisigun-heroes = callPackage ./invisigun-heroes.nix {};
    towerfall-ascension = callPackage ./towerfall-ascension.nix {};
  };
in {
  options.itch.apiKey = lib.mkOption {
    type = lib.types.nullOr lib.types.str;
    default = null;
    description = ''
      The API key of your <link xlink:href="https://itch.io/">itch.io</link>
      account, can be retrieved by heading to <link
      xlink:href="https://itch.io/user/settings/api-keys"/>.
    '';
  };

  config.packages.itch = lib.mkIf (cfg.apiKey != null) self;
}