2022-01-23 01:32:58 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (lib) mkIf;
|
2022-08-31 04:48:48 +00:00
|
|
|
caskIsPresent = cask: lib.any (x: x == cask) config.homebrew.casks;
|
|
|
|
mkIfCaskPresent = cask: mkIf (caskIsPresent cask);
|
2022-01-23 01:32:58 +00:00
|
|
|
brewEnabled = config.homebrew.enable;
|
2022-07-30 02:15:19 +00:00
|
|
|
gamesEnabled = config.games.enable;
|
2022-01-23 01:32:58 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
2022-07-29 22:01:24 +00:00
|
|
|
# perma-enabling to prevent losing brew when we skip bundling
|
|
|
|
# environment.shellInit = mkIf brewEnabled ''
|
|
|
|
environment.shellInit = ''
|
2022-01-23 01:32:58 +00:00
|
|
|
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.
|
2022-07-30 02:15:19 +00:00
|
|
|
# programs.fish.interactiveShellInit = mkIf brewEnabled ''
|
|
|
|
programs.fish.interactiveShellInit = ''
|
2022-01-23 01:32:58 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2022-07-24 19:55:26 +00:00
|
|
|
homebrew.enable = pkgs.lib.homebrew-enabled;
|
2022-01-23 01:32:58 +00:00
|
|
|
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
|
2022-08-13 19:31:44 +00:00
|
|
|
# homebrew.masApps = {
|
|
|
|
# Bitwarden = 1352778147;
|
|
|
|
# Spark = 1176895641;
|
|
|
|
# # UTM = 1538878817;
|
|
|
|
# Wireguard = 1451685025;
|
|
|
|
# Xcode = 497799835;
|
|
|
|
# };
|
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"
|
2022-06-25 01:43:47 +00:00
|
|
|
"bartender"
|
2022-08-09 02:36:06 +00:00
|
|
|
# "cursorcerer"
|
2022-09-15 21:17:21 +00:00
|
|
|
"discord"
|
|
|
|
"element"
|
2022-01-23 01:32:58 +00:00
|
|
|
"firefox"
|
2022-04-21 01:38:39 +00:00
|
|
|
"jitsi-meet"
|
2022-01-23 01:32:58 +00:00
|
|
|
"knockknock"
|
2022-09-15 21:17:21 +00:00
|
|
|
"lagrange"
|
2022-07-30 02:56:08 +00:00
|
|
|
"logitech-options"
|
2022-01-23 01:32:58 +00:00
|
|
|
"lulu"
|
2022-08-09 02:36:06 +00:00
|
|
|
"macsvg"
|
2022-08-31 04:48:48 +00:00
|
|
|
"miniforge"
|
2022-07-21 04:38:26 +00:00
|
|
|
# "mullvadvpn"
|
2022-09-15 21:17:21 +00:00
|
|
|
"obsidian"
|
2022-01-23 01:32:58 +00:00
|
|
|
"rectangle"
|
2022-07-29 22:01:24 +00:00
|
|
|
"secretive"
|
2022-01-23 01:32:58 +00:00
|
|
|
"signal"
|
2022-09-15 21:17:21 +00:00
|
|
|
"slack"
|
2022-08-29 22:52:58 +00:00
|
|
|
"stay"
|
2022-05-24 02:24:43 +00:00
|
|
|
"transmission"
|
2022-07-21 04:38:26 +00:00
|
|
|
# "twitch"
|
|
|
|
# "utm"
|
|
|
|
# "zoom"
|
2022-07-30 02:15:19 +00:00
|
|
|
] ++ lib.optionals gamesEnabled [
|
|
|
|
# games
|
|
|
|
"gog-galaxy"
|
|
|
|
"origin"
|
2022-09-04 17:39:34 +00:00
|
|
|
"sony-ps-remote-play"
|
2022-07-30 02:15:19 +00:00
|
|
|
"steam"
|
2022-01-23 01:32:58 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Configuration related to casks
|
|
|
|
environment.variables.SSH_AUTH_SOCK = mkIfCaskPresent "secretive"
|
2022-09-15 21:17:21 +00:00
|
|
|
"/Users/${config.users.primaryUser.username}/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-06-27 00:56:06 +00:00
|
|
|
homebrew.brews = [
|
2022-08-16 15:07:06 +00:00
|
|
|
"ffmpeg"
|
2022-06-27 00:56:06 +00:00
|
|
|
"fileicon"
|
|
|
|
"fzf"
|
2022-08-16 15:07:06 +00:00
|
|
|
"gifsicle"
|
2022-06-27 00:56:06 +00:00
|
|
|
"unison-language"
|
|
|
|
];
|
2022-01-23 23:50:34 +00:00
|
|
|
}
|