summaryrefslogtreecommitdiff
path: root/parts/modules/darwin/desktop/homebrew.nix
blob: a5f705ef3c6d98d6b3adccdfc9b5809d89fd207d (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
{
  config,
  lib,
  ...
}: let
  cfg = config.desktop.homebrew;
  inherit (lib) mkDefault mkEnableOption mkIf;
in {
  options.desktop.homebrew.enable = mkEnableOption "enable homebrew support";

  config = mkIf cfg.enable {
    homebrew = {
      enable = mkDefault true;
      caskArgs.require_sha = true;
      onActivation = mkDefault {
        autoUpdate = true;
        cleanup = "uninstall";
        upgrade = true;
      };

      casks = let
        # thanks @nekowinston :p
        skipSha = name: {
          inherit name;
          args = {require_sha = false;};
        };
        noQuarantine = name: {
          inherit name;
          args = {no_quarantine = true;};
        };
      in [
        (lib.recursiveUpdate (noQuarantine "chromium") (skipSha "chromium"))
      ];
    };
  };
}