dotfiles.nix/darwin/homebrew.nix

100 lines
2.4 KiB
Nix
Raw Normal View History

2023-10-26 02:37:42 +00:00
{ flake, config, lib, ... }:
let caskPresent = cask: builtins.elem cask config.homebrew.casks;
2023-08-23 00:50:29 +00:00
in {
2022-01-23 01:32:58 +00:00
# https://docs.brew.sh/Shell-Completion#configuring-completions-in-fish
2023-10-26 02:37:42 +00:00
# for some reason if the Fish completions are added at the end of `fish_complete_path` they don't
2022-01-23 01:32:58 +00:00
# seem to work, but they do work if added at the start.
2022-07-30 02:15:19 +00:00
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
'';
2023-10-26 02:37:42 +00:00
homebrew.enable = flake.inputs.homebrew-enabled.value;
2022-09-23 03:49:34 +00:00
homebrew.onActivation.autoUpdate = true;
homebrew.onActivation.upgrade = true;
2023-03-07 00:52:51 +00:00
homebrew.onActivation.cleanup = "uninstall";
2022-01-23 01:32:58 +00:00
homebrew.global.brewfile = true;
2023-10-26 02:37:42 +00:00
homebrew.taps = [ "homebrew/cask-versions" "homebrew/services" ];
2022-01-23 01:32:58 +00:00
2022-09-17 03:15:27 +00:00
homebrew.masApps = {
Bitwarden = 1352778147;
2023-10-03 23:26:13 +00:00
"Draw Things" = 6444050820;
2023-07-30 20:24:40 +00:00
GrandPerspective = 1111570163;
2023-10-03 23:26:13 +00:00
Reeder = 1529448980;
2022-10-10 21:54:15 +00:00
Tailscale = 1475387142;
2022-09-17 03:15:27 +00:00
Xcode = 497799835;
};
2022-01-23 01:32:58 +00:00
2022-12-20 02:45:46 +00:00
homebrew.caskArgs.no_quarantine = true;
2022-01-23 01:32:58 +00:00
homebrew.casks = [
2023-10-26 02:37:42 +00:00
# system tools
2022-01-23 01:32:58 +00:00
"alfred"
2023-10-26 02:37:42 +00:00
# "bartender" -> dozer
2023-10-02 23:42:46 +00:00
"dozer"
2023-10-26 02:37:42 +00:00
"itsycal"
2022-01-23 01:32:58 +00:00
"knockknock"
"lulu"
2023-07-30 20:24:40 +00:00
"protonvpn"
2023-10-26 02:37:42 +00:00
# "rectangle" -> yabai
2022-07-29 22:01:24 +00:00
"secretive"
2022-11-08 02:39:25 +00:00
"shortcat"
2022-08-29 22:52:58 +00:00
"stay"
2022-09-17 03:15:27 +00:00
"utm"
2023-10-26 02:37:42 +00:00
"yabai"
# "tools for thought"
"anytype"
# design
"krita"
"macsvg"
# browsers
"arc"
"firefox"
"orion"
# messaging apps
"signal"
# editors and IDEs
"lapce"
"zed"
# terminal emulators
"warp"
# peripheral tools
"logi-options-plus"
"qflipper"
"remarkable"
"via"
2022-01-23 01:32:58 +00:00
];
2023-10-26 02:37:42 +00:00
# TODO: figure out `brew shellenv` settings
# environment.variables = {
# HOMEBREW_PREFIX = "";
# HOMEBREW_CELLAR = "";
# HOMEBREW_REPOSITORY = "";
# };
# environment.systemPath = [ ];
2022-12-21 05:22:57 +00:00
2023-10-26 02:37:42 +00:00
# configure ssh to use secretive's agent
# TODO: move to module?
home-manager.users.${flake.config.people.me} =
lib.mkIf (caskPresent "secretive" && config ? home-manager) (let
socket =
"${config.home.homeDirectory}/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh";
in {
home.sessionVariables.SSH_AUTH_SOCK = socket;
programs.ssh.matchBlocks = {
"*".extraOptions = { IdentityAgent = socket; };
};
});
}