dotfiles.nix/darwin/homebrew.nix

111 lines
2.9 KiB
Nix
Raw Normal View History

2022-12-21 05:22:57 +00:00
{ config, pkgs, lib, ... }:
let
inherit (config.users) primaryUser;
caskPresent = cask: lib.any (x: x.name == cask) config.homebrew.casks;
2023-08-23 00:50:29 +00:00
in {
2022-07-29 22:01:24 +00:00
environment.shellInit = ''
2023-08-23 01:42:47 +00:00
eval "$(${config.homebrew.brewPrefix}/brew shellenv fish)"
2022-01-23 01:32:58 +00:00
'';
# 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 = ''
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
'';
homebrew.enable = pkgs.lib.homebrew-enabled;
2022-09-23 03:49:34 +00:00
homebrew.onActivation.autoUpdate = true;
homebrew.onActivation.upgrade = true;
2023-03-07 00:52:51 +00:00
# TODO: open an issue to have this make backup folders?
# homebrew.onActivation.cleanup = "zap";
homebrew.onActivation.cleanup = "uninstall";
2022-01-23 01:32:58 +00:00
homebrew.global.brewfile = true;
homebrew.taps = [
"homebrew/cask-versions"
"homebrew/services"
"nrlquaker/createzap"
"unisonweb/unison"
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-09-17 03:15:27 +00:00
Spark = 1176895641;
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
# 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.
2022-12-20 02:45:46 +00:00
homebrew.caskArgs.no_quarantine = true;
2022-01-23 01:32:58 +00:00
homebrew.casks = [
"alfred"
2023-07-30 20:24:40 +00:00
"anytype"
"arc"
2023-10-02 23:42:46 +00:00
# "bartender"
# "discord"
2023-10-02 23:42:46 +00:00
"dozer"
2022-01-23 01:32:58 +00:00
"firefox"
2023-03-11 17:53:23 +00:00
"hazeover"
2022-04-21 01:38:39 +00:00
"jitsi-meet"
2022-01-23 01:32:58 +00:00
"knockknock"
2023-07-30 20:24:40 +00:00
"krita"
# "lagrange"
2023-04-08 18:33:47 +00:00
"lapce"
"logi-options-plus"
2022-01-23 01:32:58 +00:00
"lulu"
2022-08-09 02:36:06 +00:00
"macsvg"
2023-01-04 00:37:05 +00:00
"messenger"
2023-08-22 22:55:12 +00:00
"nova"
# "obsidian"
2023-10-02 23:42:46 +00:00
"orion"
2023-07-30 20:24:40 +00:00
"protonvpn"
2023-01-04 00:37:05 +00:00
"qflipper"
2022-01-23 01:32:58 +00:00
"rectangle"
2023-01-04 00:37:05 +00:00
"remarkable"
2022-07-29 22:01:24 +00:00
"secretive"
2022-11-08 02:39:25 +00:00
"shortcat"
2022-01-23 01:32:58 +00:00
"signal"
# "slack"
2022-08-29 22:52:58 +00:00
"stay"
2023-07-30 20:24:40 +00:00
"transmission-remote-gui"
2022-09-17 03:15:27 +00:00
"utm"
"via"
2023-07-30 20:24:40 +00:00
# "wacom-tablet"
# "zoom"
2022-01-23 01:32:58 +00:00
];
2023-08-23 00:50:29 +00:00
home-manager.users.${primaryUser.username} = let
socket =
"${primaryUser.homeDirectory}/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh";
in lib.mkIf (caskPresent "secretive" && config ? home-manager) {
home.sessionVariables.SSH_AUTH_SOCK = socket;
programs.ssh = {
enable = true;
matchBlocks."*".extraOptions = { IdentityAgent = socket; };
2022-12-21 05:22:57 +00:00
};
2023-08-23 00:50:29 +00:00
};
2022-12-21 05:22:57 +00:00
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/programs.nix` whenever possible.
2022-06-27 00:56:06 +00:00
homebrew.brews = [
"ffmpeg"
2022-06-27 00:56:06 +00:00
"fileicon"
"fzf"
"gifsicle"
2023-07-30 20:24:40 +00:00
"netlify-cli"
2022-10-10 21:54:15 +00:00
"tarsnap"
2022-09-26 02:34:46 +00:00
"unison-language"
2023-08-08 23:58:05 +00:00
"yarn"
2022-06-27 00:56:06 +00:00
];
}