Migration This is my new public git source viewer. Source coming soon. Please contact with concerns/bugs. Contact me

users/ryan/common.nix

4e6cd5530a533ca220b164472689dd8fd0106889 · 5.0 KB · 213 lines raw

1 { config, pkgs, lib, ... }:
2
3 {
4 imports = [ ./modules/nvim ./modules/aria2 ];
5
6 news.display = "silent";
7
8 # Keep everything in lockstep
9 home.stateVersion = "26.05";
10
11 # My own modules
12 ryan.neovim.enable = true;
13
14 ryan.aria2.enable = true;
15
16 programs.starship = {
17 enable = true;
18 settings = {
19 add_newline = false;
20 character = {
21 success_symbol = "[➜](bold green)";
22 error_symbol = "[➜](bold red)";
23 };
24 time = {
25 disabled = false;
26 format = "\[ $time \]($style)";
27 time_format = "%T";
28 };
29 };
30 };
31
32 # Package/platform overrides (darwinDefaultsId, package = null for homebrew,
33 # etc.) live in darwin.nix/linux.nix. Policies/profile are shared.
34 programs.zen-browser = {
35 enable = true;
36 policies = import ./zen/zenPolicies.nix;
37 profiles.default = import ./zen/zenProfile.nix;
38 };
39
40 programs.eza = {
41 enable = true;
42 enableZshIntegration = true;
43 };
44
45 programs.gpg.enable = true;
46
47 programs.git = {
48 enable = true;
49 signing.signByDefault = true;
50 settings = {
51 user = {
52 name = "Ryan Schanzenbacher";
53 email = "ryan@rschanz.org";
54 };
55 core.pager = "${pkgs.delta}/bin/delta";
56 init.defaultBranch = "main";
57 merge.conflictStyle = "zdiff3";
58 interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only";
59 delta = {
60 navigate = true;
61 side-by-side = true;
62 };
63 # Merged from guix-dotfiles' ~/.gitconfig - git-lfs filter and
64 # git send-email settings, missing from the darwin config until now.
65 filter.lfs = {
66 clean = "git-lfs clean -- %f";
67 smudge = "git-lfs smudge -- %f";
68 process = "git-lfs filter-process";
69 required = true;
70 };
71 sendemail = {
72 smtpserver = "mail.rschanz.org";
73 smtpuser = "ryan@rschanz.org";
74 smtpencryption = "ssl";
75 smtpserverport = 465;
76 };
77 };
78 };
79
80 programs.ssh = {
81 enable = true;
82 package = null; # installed by default
83
84 enableDefaultConfig = false;
85
86 settings = {
87 "rocApex" = {
88 hostname = "129.158.232.104";
89 user = "root";
90 };
91 "hetzner" = {
92 hostname = "5.161.207.21";
93 user = "root";
94 };
95 "rncorepub" = {
96 hostname = "5.161.89.186";
97 user = "root";
98 };
99 # Merged from guix-dotfiles' ~/.ssh/config - hosts and quirks missing
100 # from the darwin config until now.
101 "linode" = {
102 hostname = "97.107.142.58";
103 user = "root";
104 };
105 # `settings` has a freeform type, so upstream ssh_config directive
106 # names can be set directly - `programs.ssh.settings.*.extraOptions`
107 # is explicitly unsupported (hard assertion failure) in this HM version.
108 "192.168.216.1" = {
109 HostKeyAlgorithms = "+ssh-rsa";
110 PubkeyAcceptedAlgorithms = "+ssh-rsa";
111 };
112 "*" = {
113 KexAlgorithms = "-sntrup761x25519-sha512@openssh.com";
114 };
115 };
116
117 extraConfig = ''
118 Match host * exec "gpg-connect-agent UPDATESTARTUPTTY /bye"
119 '';
120 };
121
122 services.gpg-agent = {
123 enable = pkgs.stdenv.isLinux;
124 enableSshSupport = true;
125 };
126
127 programs.fzf = {
128 enable = true;
129 enableZshIntegration = true;
130 };
131
132 programs.zsh = {
133 enable = true;
134 initContent = let
135 brewPath = if pkgs.stdenv.isDarwin && pkgs.stdenv.isAarch64 then ''
136 eval "$(/opt/homebrew/bin/brew shellenv)"
137 '' else "";
138 in ''
139 export GPG_TTY="$(tty)"
140 export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
141 gpgconf --launch gpg-agent
142 gpg-connect-agent updatestartuptty /bye > /dev/null
143 ${brewPath}
144 '';
145 shellAliases = {
146 cat = "bat --paging=never";
147 diff = "delta";
148 brew = "env -u XDG_CONFIG_HOME brew";
149 grep = "grep --color=auto";
150 ll = "ls -l";
151 rebuild =
152 if pkgs.stdenv.isDarwin
153 then "sudo darwin-rebuild switch --flake ~/.config/nix/."
154 else "home-manager switch --flake ~/.config/home-manager/#ryan";
155 };
156 plugins = [
157 {
158 name = "zsh-vi-mode";
159 src = "${pkgs.zsh-vi-mode}/share/zsh-vi-mode";
160 }
161 ];
162 };
163
164 # Shared across darwin and linux; the guix side already deferred these
165 # packages to nix (all commented out of home-configuration.scm's package
166 # list), same as the darwin config always has.
167 home.packages = with pkgs; [
168 bat
169 fd
170 fzf
171 tmux
172 restic
173 rsync
174 pv
175 jq
176 htop
177 (pkgs.zathura.override {
178 plugins = [ pkgs.zathuraPkgs.zathura_pdf_mupdf ];
179 })
180 go
181 pass
182 file
183 pandoc
184 weechat
185 python3
186 yt-dlp
187 aerc
188 gdu
189 taskwarrior3
190 delta
191 prismlauncher
192 git-lfs
193 audacity
194 blender
195
196 nerd-fonts.anonymice
197 nerd-fonts.monofur
198 nerd-fonts.lilex
199 nerd-fonts.fira-code
200 ];
201
202 xdg.configFile."aerc" = {
203 source = ./aerc;
204 recursive = true;
205 };
206
207 home.sessionVariables = {
208 XDG_CONFIG_HOME = "${config.home.homeDirectory}/.config";
209 EDITOR = "${pkgs.neovim}/bin/nvim";
210 };
211
212 programs.home-manager.enable = true;
213 }