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

users/ryan/common.nix

b7d807c39733ce101c55286d6428c19fb31c1ef3 · 4.8 KB · 207 lines raw

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