summaryrefslogtreecommitdiff
path: root/users/ryan/home.nix
blob: de776c48e3f292a441c8c929b1d88158a7efe008 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
{ config, pkgs, lib, ... }:

{
  # This value determines the Home Manager release that your configuration is
  # compatible with. This helps avoid breakage when a new Home Manager release
  # introduces backwards incompatible changes.
  #
  # You should not change this value, even if you update Home Manager. If you do
  # want to update the value, then make sure to first check the Home Manager
  # release notes.
  home.stateVersion = "26.05"; # Please read the comment before changing.

  news.display = "silent";

  programs.starship = {
    enable = true;
    settings = {
      add_newline = false;
      character = {
        success_symbol = "[➜](bold green)";
	error_symbol = "[➜](bold red)";
      };
      time = {
        disabled = false;
	format = "\[ $time \]($style)";
	time_format = "%T";
      };
    };
  };

  programs.zen-browser = {
    enable = true;
    package = null; # managed via homebrew
    darwinDefaultsId = "app.zen-browser.zen";
    policies = import ./zen/zenPolicies.nix;
    profiles.default = import ./zen/zenProfile.nix;
  };

  programs.eza = {
    enable = true;
    enableZshIntegration = true;
  };

  programs.gpg.enable = true;

  programs.git = {
    enable = true;
    signing.signByDefault = true;
    settings = {
      user = {
        name = "Ryan Schanzenbacher";
        email = "ryan@rschanz.org";
      };
      core.pager = "${pkgs.delta}/bin/delta";
      init.defaultBranch = "main";
      merge.conflictStyle = "zdiff3";
      interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only";
      delta = {
        navigate = true;
	side-by-side = true;
      };
    };
  };

  services.gpg-agent = {
    enable = true;
    enableSshSupport = true;
  };

  programs.zsh = {
    enable = true;
    initContent = ''
      export GPG_TTY="$(tty)"
      export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
      gpgconf --launch gpg-agent
      gpg-connect-agent updatestartuptty /bye > /dev/null
    '';
    shellAliases = {
      cat = "bat --paging=never";
      diff = "delta";
    };
  };

  # The home.packages option allows you to install Nix packages into your
  # environment.
  home.packages = with pkgs; [
	neovim
	git
	yt-dlp
	aerc
	gdu
	taskwarrior3
	delta
	bat
	pass
	pandoc
	iina # Media player (frontend to mpv essentially)
  ];

  # Home Manager is pretty good at managing dotfiles. The primary way to manage
  # plain files is through 'home.file'.
  home.file = {
    # # Building this configuration will create a copy of 'dotfiles/screenrc' in
    # # the Nix store. Activating the configuration will then make '~/.screenrc' a
    # # symlink to the Nix store copy.
    # ".screenrc".source = dotfiles/screenrc;

    # # You can also set the file content immediately.
    # ".gradle/gradle.properties".text = ''
    #   org.gradle.console=verbose
    #   org.gradle.daemon.idletimeout=3600000
    # '';
  };

  # Install User apps to subdir for dock stuff
  targets.darwin.linkApps.directory = "Applications/User Apps";

  # Symlink System apps into the user apps "system" dir
  home.activation.linkSystemApps = lib.hm.dag.entryAfter ["writeBoundary"] ''
    if [[ -z "$HOME" ]]; then
      echo "ERROR: HOME was not defined. This should not happen. Bailing! ">&2
      exit 1
    fi

    $DRY_RUN_CMD mkdir -p "$HOME/Applications/System Apps"

    $DRY_RUN_CMD rm -rf "$HOME/Applications/System Apps/"*.app

    $DRY_RUN_CMD find /Applications /System/Applications -maxdepth 2 -name "*.app" \
      -prune -exec ln -sf {} "$HOME/Applications/System Apps/" \;
  '';

  xdg.configFile."aerc" = {
    source = ./aerc;
    recursive = true;
  };

  home.sessionVariables = {
    XDG_CONFIG_HOME = "${config.home.homeDirectory}/.config";
    EDITOR = "${pkgs.neovim}/bin/nvim";
  };

  # Let Home Manager install and manage itself.
  programs.home-manager.enable = true;
}