diff options
Diffstat (limited to 'users/ryan/common.nix')
| -rw-r--r-- | users/ryan/common.nix | 180 |
1 files changed, 180 insertions, 0 deletions
diff --git a/users/ryan/common.nix b/users/ryan/common.nix new file mode 100644 index 0000000..2e7505f --- /dev/null +++ b/users/ryan/common.nix | |||
| @@ -0,0 +1,180 @@ | |||
| 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 | # HM always renders the "*" block last regardless of dag order, so this | ||
| 113 | # trailing exec-only Match block (no directives of its own - position | ||
| 114 | # relative to the Host blocks above doesn't matter) is safe to append here. | ||
| 115 | # `settings."*"` above satisfies the assertion that gates using extraConfig. | ||
| 116 | extraConfig = '' | ||
| 117 | Match host * exec "gpg-connect-agent UPDATESTARTUPTTY /bye" | ||
| 118 | ''; | ||
| 119 | }; | ||
| 120 | |||
| 121 | services.gpg-agent = { | ||
| 122 | enable = pkgs.stdenv.isLinux; | ||
| 123 | enableSshSupport = 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 | # Merged from guix-dotfiles' bash aliases (home-bash-service-type) - | ||
| 143 | # bash is being retired there in favor of this zsh config. `ls`/`spt`/ | ||
| 144 | # `python` are Linux-only (BSD ls on darwin doesn't take --color/-p, | ||
| 145 | # spotify_player and python3 aren't darwin things) - see linux.nix. | ||
| 146 | grep = "grep --color=auto"; | ||
| 147 | ll = "ls -l"; | ||
| 148 | rebuild = | ||
| 149 | if pkgs.stdenv.isDarwin | ||
| 150 | then "sudo darwin-rebuild switch --flake ~/.config/nix/." | ||
| 151 | else "home-manager switch --flake ~/.config/home-manager/#ryan"; | ||
| 152 | }; | ||
| 153 | }; | ||
| 154 | |||
| 155 | # Shared across darwin and linux; the guix side already deferred these | ||
| 156 | # packages to nix (all commented out of home-configuration.scm's package | ||
| 157 | # list), same as the darwin config always has. | ||
| 158 | home.packages = with pkgs; [ | ||
| 159 | yt-dlp | ||
| 160 | aerc | ||
| 161 | gdu | ||
| 162 | taskwarrior3 | ||
| 163 | delta | ||
| 164 | kubectl | ||
| 165 | talhelper | ||
| 166 | talosctl | ||
| 167 | ]; | ||
| 168 | |||
| 169 | xdg.configFile."aerc" = { | ||
| 170 | source = ./aerc; | ||
| 171 | recursive = true; | ||
| 172 | }; | ||
| 173 | |||
| 174 | home.sessionVariables = { | ||
| 175 | XDG_CONFIG_HOME = "${config.home.homeDirectory}/.config"; | ||
| 176 | EDITOR = "${pkgs.neovim}/bin/nvim"; | ||
| 177 | }; | ||
| 178 | |||
| 179 | programs.home-manager.enable = true; | ||
| 180 | } | ||
