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

users/ryan/common.nix

3d323731bc263a72c8429f79186f8d9d0c704213 · 5.0 KB · 211 lines raw

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