summaryrefslogtreecommitdiff
path: root/users/ryan/home.nix
blob: af8770b3b09bb667144d30422c4e43105cc39910 (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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
{ 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.
  imports = [ ./modules ];
  home.stateVersion = "26.05"; # Please read the comment before changing.

  news.display = "silent";

  # My own modules
  ryan.neovim.enable = true;

  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;
      };
    };
  };

  programs.ssh = {
    enable = true;
    package = null; # installed by default

    enableDefaultConfig = false;

    settings = {
      "rocApex" = {
        hostname = "129.158.232.104";
        user = "root";
      };
      "hetzner" = {
        hostname = "5.161.207.21";
        user = "root";
      };
      "rncorepub" = {
        hostname = "5.161.89.186";
        user = "root";
      };
    };
  };

  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";
      rebuild = "sudo darwin-rebuild switch --flake ~/.config/nix/.";
    };
  };

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

  # 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;
}