flake/users/guanranwang/home-manager/darwin/home.nix

97 lines
2.1 KiB
Nix
Raw Normal View History

2023-09-19 00:17:43 +00:00
{ config, pkgs, lib, ... }:
{
home = {
username = "guanranwang";
homeDirectory = "/Users/guanranwang";
activation = {
2023-10-09 06:52:33 +00:00
# Workaround for spotlight indexing
# https://github.com/nix-community/home-manager/issues/1341#issuecomment-1705731962_
2023-09-19 00:17:43 +00:00
trampolineApps = let
apps = pkgs.buildEnv {
name = "home-manager-applications";
paths = config.home.packages;
pathsToLink = "/Applications";
};
in lib.hm.dag.entryAfter [ "writeBoundary" ] ''
toDir="$HOME/Applications/Home Manager Trampolines"
fromDir="${apps}/Applications/"
rm -rf "$toDir"
mkdir "$toDir"
(
cd "$fromDir"
for app in *.app; do
/usr/bin/osacompile -o "$toDir/$app" -e 'do shell script "open '$fromDir/$app'"'
done
)
'';
2023-10-09 06:52:33 +00:00
setSystemProxy = let networksetup = /usr/sbin/networksetup;
in lib.hm.dag.entryAfter ["writeBoundary"] ''
${networksetup} -setwebproxystate "Wi-fi" on
${networksetup} -setwebproxy "Wi-fi" 127.0.0.1 7890
${networksetup} -setwebproxystate "Ethernet" on
${networksetup} -setwebproxy "Ethernet" 127.0.0.1 7890
'';
2023-09-19 00:17:43 +00:00
};
packages = with pkgs; [
## CLI
### outdated macOS components
coreutils
vim
gnugrep
openssh
screen
### Misc
2023-09-19 00:17:43 +00:00
eza
bottom
bat
fd
git
ripgrep
yt-dlp
aria2
android-tools
2023-09-23 21:46:18 +00:00
skim
2023-10-19 15:12:06 +00:00
ydict
2023-09-19 00:17:43 +00:00
## GUI
### Music
2023-09-19 00:17:43 +00:00
spotify
spicetify-cli
yesplaymusic
mpv
### Tools
keka # un-archive-r
iterm2
### Misc
element-desktop
2023-09-19 00:17:43 +00:00
];
};
# macOS don't have fontconfig
programs = let
monospace = "JetBrainsMono Nerd Font";
in {
vscode.userSettings = {
"editor.fontFamily" = "${monospace}";
};
alacritty.settings.font = {
normal = {
family = "${monospace}";
};
bold = {
family = "${monospace}";
};
bold_italic = {
family = "${monospace}";
};
italic = {
family = "${monospace}";
};
};
};
}