2022-01-23 01:32:58 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (lib) mkIf;
|
|
|
|
mkIfCaskPresent = cask: mkIf (lib.any (x: x == cask) config.homebrew.casks);
|
|
|
|
brewEnabled = config.homebrew.enable;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
environment.shellInit = mkIf brewEnabled ''
|
|
|
|
eval "$(${config.homebrew.brewPrefix}/brew shellenv)"
|
|
|
|
'';
|
|
|
|
|
|
|
|
# https://docs.brew.sh/Shell-Completion#configuring-completions-in-fish
|
|
|
|
# For some reason if the Fish completions are added at the end of `fish_complete_path` they don't
|
|
|
|
# seem to work, but they do work if added at the start.
|
|
|
|
programs.fish.interactiveShellInit = mkIf brewEnabled ''
|
|
|
|
if test -d (brew --prefix)"/share/fish/completions"
|
|
|
|
set -p fish_complete_path (brew --prefix)/share/fish/completions
|
|
|
|
end
|
|
|
|
if test -d (brew --prefix)"/share/fish/vendor_completions.d"
|
|
|
|
set -p fish_complete_path (brew --prefix)/share/fish/vendor_completions.d
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
|
|
|
|
homebrew.enable = true;
|
|
|
|
homebrew.autoUpdate = true;
|
|
|
|
homebrew.cleanup = "zap";
|
|
|
|
homebrew.global.brewfile = true;
|
|
|
|
homebrew.global.noLock = true;
|
|
|
|
|
|
|
|
homebrew.taps = [
|
|
|
|
"homebrew/cask"
|
|
|
|
"homebrew/cask-drivers"
|
|
|
|
"homebrew/cask-fonts"
|
|
|
|
"homebrew/cask-versions"
|
|
|
|
"homebrew/core"
|
|
|
|
"homebrew/services"
|
|
|
|
"nrlquaker/createzap"
|
2022-01-23 23:50:34 +00:00
|
|
|
"unisonweb/unison"
|
2022-01-23 01:32:58 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Prefer installing application from the Mac App Store
|
|
|
|
homebrew.masApps = {
|
|
|
|
Bitwarden = 1352778147;
|
2022-01-23 23:50:34 +00:00
|
|
|
Spark = 1176895641;
|
2022-01-23 01:32:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# If an app isn't available in the Mac App Store, or the version in the App Store has
|
|
|
|
# limitiations, e.g., Transmit, install the Homebrew Cask.
|
|
|
|
homebrew.casks = [
|
2022-01-23 23:50:34 +00:00
|
|
|
"aerial"
|
2022-01-23 01:32:58 +00:00
|
|
|
"alfred"
|
|
|
|
"discord"
|
|
|
|
"element"
|
|
|
|
"firefox"
|
|
|
|
"gog-galaxy"
|
|
|
|
"knockknock"
|
|
|
|
"lagrange"
|
|
|
|
"lulu"
|
2022-02-05 21:53:35 +00:00
|
|
|
"mullvadvpn"
|
2022-02-07 05:09:16 +00:00
|
|
|
"obsidian"
|
2022-01-23 01:32:58 +00:00
|
|
|
"rectangle"
|
|
|
|
"signal"
|
|
|
|
"steam"
|
|
|
|
"vscodium"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Configuration related to casks
|
|
|
|
environment.variables.SSH_AUTH_SOCK = mkIfCaskPresent "secretive"
|
2022-01-23 23:50:34 +00:00
|
|
|
"/Users/${config.users.primaryUser}/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh";
|
2022-01-23 01:32:58 +00:00
|
|
|
|
|
|
|
# For cli packages that aren't currently available for macOS in `nixpkgs`.Packages should be
|
|
|
|
# installed in `../home/default.nix` whenever possible.
|
2022-02-05 21:53:35 +00:00
|
|
|
homebrew.brews = [ "fzf" "unison-language" ];
|
2022-01-23 23:50:34 +00:00
|
|
|
}
|