users/ryan/common.nix

0ce4331f742863ec03c711c27b0a0dee7e8cc187 · 4.6 KB · 193 lines raw

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