users/ryan/home.nix

8f0d8e6dfe4632c461658a7db8f0eeb5261d62df · 4.4 KB · 176 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 = ''
99 export GPG_TTY="$(tty)"
100 export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
101 gpgconf --launch gpg-agent
102 gpg-connect-agent updatestartuptty /bye > /dev/null
103 '';
104 shellAliases = {
105 cat = "bat --paging=never";
106 diff = "delta";
107 rebuild = "sudo darwin-rebuild switch --flake ~/.config/nix/.";
108 };
109 };
110
111 # The home.packages option allows you to install Nix packages into your
112 # environment.
113 home.packages = with pkgs; [
114 git
115 yt-dlp
116 aerc
117 gdu
118 taskwarrior3
119 delta
120 bat
121 pass
122 pandoc
123 iina # Media player (frontend to mpv essentially)
124 kubectl
125 talhelper
126 talosctl
127 audacity
128 ffmpeg
129 ];
130
131 # Home Manager is pretty good at managing dotfiles. The primary way to manage
132 # plain files is through 'home.file'.
133 home.file = {
134 # # Building this configuration will create a copy of 'dotfiles/screenrc' in
135 # # the Nix store. Activating the configuration will then make '~/.screenrc' a
136 # # symlink to the Nix store copy.
137 # ".screenrc".source = dotfiles/screenrc;
138
139 # # You can also set the file content immediately.
140 # ".gradle/gradle.properties".text = ''
141 # org.gradle.console=verbose
142 # org.gradle.daemon.idletimeout=3600000
143 # '';
144 };
145
146 # Install User apps to subdir for dock stuff
147 targets.darwin.linkApps.directory = "Applications/User Apps";
148
149 # Symlink System apps into the user apps "system" dir
150 home.activation.linkSystemApps = lib.hm.dag.entryAfter ["writeBoundary"] ''
151 if [[ -z "$HOME" ]]; then
152 echo "ERROR: HOME was not defined. This should not happen. Bailing! ">&2
153 exit 1
154 fi
155
156 $DRY_RUN_CMD mkdir -p "$HOME/Applications/System Apps"
157
158 $DRY_RUN_CMD rm -rf "$HOME/Applications/System Apps/"*.app
159
160 $DRY_RUN_CMD find /Applications /System/Applications -maxdepth 2 -name "*.app" \
161 -prune -exec ln -sf {} "$HOME/Applications/System Apps/" \;
162 '';
163
164 xdg.configFile."aerc" = {
165 source = ./aerc;
166 recursive = true;
167 };
168
169 home.sessionVariables = {
170 XDG_CONFIG_HOME = "${config.home.homeDirectory}/.config";
171 EDITOR = "${pkgs.neovim}/bin/nvim";
172 };
173
174 # Let Home Manager install and manage itself.
175 programs.home-manager.enable = true;
176 }