users/ryan/darwin.nix

main · 1.6 KB · 57 lines raw

1 { config, pkgs, lib, ... }:
2
3 {
4 imports = [
5 ./modules/sketchybar
6 ./modules/simple-bar
7 ./modules/taskwarrior-ubersicht
8 ./modules/ubersicht
9 ];
10
11 ryan.sketchybar.enable = true;
12
13 programs.zen-browser = {
14 package = null; # managed via homebrew
15 darwinDefaultsId = "app.zen-browser.zen";
16 };
17
18 # Need special config for gpg-agent on macOS
19 home.file.".gnupg/gpg-agent.conf".text = ''
20 pinentry-program ${pkgs.pinentry_mac}/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac
21 enable-ssh-support
22 '';
23
24 # Add hammerspoon
25 home.file.".hammerspoon".source = ./hammerspoon;
26
27 home.file.".config/homebrew".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.homebrew";
28
29 home.packages = with pkgs; [
30 iina # Media player (frontend to mpv essentially)
31 jujutsu
32 netbird-tui
33 ];
34
35 # Install User apps to subdir for dock stuff
36 targets.darwin.linkApps.directory = "Applications/User Apps";
37
38 # Symlink System apps into the user apps "system" dir
39 home.activation.linkSystemApps = lib.hm.dag.entryAfter ["writeBoundary"] ''
40 if [[ -z "$HOME" ]]; then
41 echo "ERROR: HOME was not defined. This should not happen. Bailing! ">&2
42 exit 1
43 fi
44
45 $DRY_RUN_CMD mkdir -p "$HOME/Applications/System Apps"
46
47 $DRY_RUN_CMD rm -rf "$HOME/Applications/System Apps/"*.app
48
49 $DRY_RUN_CMD find /Applications /System/Applications -maxdepth 2 -name "*.app" \
50 -prune -exec ln -sf {} "$HOME/Applications/System Apps/" \;
51 '';
52
53 # Restart gpg-agent
54 home.activation.restartGpgAgent = lib.hm.dag.entryAfter ["writeBoundary"] ''
55 $DRY_RUN_CMD ${pkgs.gnupg}/bin/gpgconf --kill gpg-agent || true
56 '';
57 }