Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/darwin/homebrew.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ let

# Productivity
"finicky"
"granola"
"linear"
"miro"

Expand Down
27 changes: 26 additions & 1 deletion users/gkhaykin/programs/finicky.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,32 @@ lib.mkIf pkgs.stdenv.hostPlatform.isDarwin {
# Home Manager has no default-browser option, so use duti (a macOS
# LaunchServices CLI) to register Finicky as the HTTP(S) URL handler.
home.packages = [ pkgs.duti ];
home.file.".finicky.ts".source = ./finicky.ts;
home.file.".finicky.ts" = {
source = ./finicky.ts;

# Finicky resolves the Home Manager symlink and watches its immutable
# Nix-store target. Restart it when the symlink changes so it watches and
# loads the new target.
onChange = ''
if [[ -v DRY_RUN ]]; then
verboseEcho "Would restart Finicky to load its updated configuration"
elif /usr/bin/pgrep -x Finicky >/dev/null; then
/usr/bin/killall Finicky

attempts=0
while /usr/bin/pgrep -x Finicky >/dev/null && (( attempts < 50 )); do
/bin/sleep 0.1
(( attempts += 1 ))
done

if /usr/bin/pgrep -x Finicky >/dev/null; then
echo "warning: Finicky did not stop; restart it manually to load the updated configuration" >&2
else
/usr/bin/open --env PATH=/usr/bin:/bin:/usr/sbin:/sbin -a Finicky
fi
fi
'';
};
home.activation.setFinickyAsDefaultBrowser = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
run ${lib.getExe pkgs.duti} -s se.johnste.finicky http
'';
Expand Down
1 change: 0 additions & 1 deletion users/shared/programs/vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
],
/* Python */
"python-envs.alwaysUseUv": true,
"python.defaultInterpreterPath": "/opt/homebrew/bin/python3",
/* Kubernetes */
// GUI-launched editors don't inherit the shell PATH, so point at the asdf shim
// (it execs asdf via an absolute nix-store path and needs no environment).
Expand Down