users/ryan/home.nix

94ddd4b8cf401ef424328478bffaa9cee794d07e · 4.5 KB · 182 lines raw

1 { config, pkgs, lib, ... }:
2
3 {
4 # This value determines the Home Manager release that your configuration is
5 # compatible with. This helps avoid breakage when a new Home Manager release
6 # introduces backwards incompatible changes.
7 #
8 # You should not change this value, even if you update Home Manager. If you do
9 # want to update the value, then make sure to first check the Home Manager
10 # release notes.
11 imports = [ ./modules ];
12 home.stateVersion = "26.05"; # Please read the comment before changing.
13
14 news.display = "silent";
15
16 # My own modules
17 ryan.neovim.enable = true;
18
19 programs.starship = {
20 enable = true;
21 settings = {
22 add_newline = false;
23 character = {
24 success_symbol = "[➜](bold green)";
25 error_symbol = "[➜](bold red)";
26 };
27 time = {
28 disabled = false;
29 format = "\[ $time \]($style)";
30 time_format = "%T";
31 };
32 };
33 };
34
35 programs.zen-browser = {
36 enable = true;
37 package = null; # managed via homebrew
38 darwinDefaultsId = "app.zen-browser.zen";
39 policies = import ./zen/zenPolicies.nix;
40 profiles.default = import ./zen/zenProfile.nix;
41 };
42
43 programs.eza = {
44 enable = true;
45 enableZshIntegration = true;
46 };
47
48 programs.gpg.enable = true;
49
50 programs.git = {
51 enable = true;
52 signing.signByDefault = true;
53 settings = {
54 user = {
55 name = "Ryan Schanzenbacher";
56 email = "ryan@rschanz.org";
57 };
58 core.pager = "${pkgs.delta}/bin/delta";
59 init.defaultBranch = "main";
60 merge.conflictStyle = "zdiff3";
61 interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only";
62 delta = {
63 navigate = true;
64 side-by-side = true;
65 };
66 };
67 };
68
69 programs.ssh = {
70 enable = true;
71 package = null; # installed by default
72
73 enableDefaultConfig = false;
74
75 settings = {
76 "rocApex" = {
77 hostname = "129.158.232.104";
78 user = "root";
79 };
80 "hetzner" = {
81 hostname = "5.161.207.21";
82 user = "root";
83 };
84 "rncorepub" = {
85 hostname = "5.161.89.186";
86 user = "root";
87 };
88 };
89 };
90
91 services.gpg-agent = {
92 enable = true;
93 enableSshSupport = true;
94 };
95
96 programs.zsh = {
97 enable = true;
98 initContent = let
99 brewPath = if pkgs.stdenv.isDarwin && pkgs.stdenv.isAarch64 then ''
100 eval "$(/opt/homebrew/bin/brew shellenv)"
101 '' else "";
102 in ''
103 export GPG_TTY="$(tty)"
104 export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
105 gpgconf --launch gpg-agent
106 gpg-connect-agent updatestartuptty /bye > /dev/null
107 ${brewPath}
108 '';
109 shellAliases = {
110 cat = "bat --paging=never";
111 diff = "delta";
112 rebuild = "sudo darwin-rebuild switch --flake ~/.config/nix/.";
113 };
114 };
115
116 # The home.packages option allows you to install Nix packages into your
117 # environment.
118 home.packages = with pkgs; [
119 git
120 yt-dlp
121 aerc
122 gdu
123 taskwarrior3
124 delta
125 bat
126 pass
127 pandoc
128 iina # Media player (frontend to mpv essentially)
129 kubectl
130 talhelper
131 talosctl
132 audacity
133 ffmpeg
134 blender
135 ];
136
137 # Home Manager is pretty good at managing dotfiles. The primary way to manage
138 # plain files is through 'home.file'.
139 home.file = {
140 # # Building this configuration will create a copy of 'dotfiles/screenrc' in
141 # # the Nix store. Activating the configuration will then make '~/.screenrc' a
142 # # symlink to the Nix store copy.
143 # ".screenrc".source = dotfiles/screenrc;
144
145 # # You can also set the file content immediately.
146 # ".gradle/gradle.properties".text = ''
147 # org.gradle.console=verbose
148 # org.gradle.daemon.idletimeout=3600000
149 # '';
150 };
151
152 # Install User apps to subdir for dock stuff
153 targets.darwin.linkApps.directory = "Applications/User Apps";
154
155 # Symlink System apps into the user apps "system" dir
156 home.activation.linkSystemApps = lib.hm.dag.entryAfter ["writeBoundary"] ''
157 if [[ -z "$HOME" ]]; then
158 echo "ERROR: HOME was not defined. This should not happen. Bailing! ">&2
159 exit 1
160 fi
161
162 $DRY_RUN_CMD mkdir -p "$HOME/Applications/System Apps"
163
164 $DRY_RUN_CMD rm -rf "$HOME/Applications/System Apps/"*.app
165
166 $DRY_RUN_CMD find /Applications /System/Applications -maxdepth 2 -name "*.app" \
167 -prune -exec ln -sf {} "$HOME/Applications/System Apps/" \;
168 '';
169
170 xdg.configFile."aerc" = {
171 source = ./aerc;
172 recursive = true;
173 };
174
175 home.sessionVariables = {
176 XDG_CONFIG_HOME = "${config.home.homeDirectory}/.config";
177 EDITOR = "${pkgs.neovim}/bin/nvim";
178 };
179
180 # Let Home Manager install and manage itself.
181 programs.home-manager.enable = true;
182 }