From 0c8fa3a2a270747f3dbb54fe8792f3f0aec997e3 Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Mon, 3 Aug 2026 01:22:44 -0400 Subject: Initial commit: combined darwin + guix-linux home-manager flake Supersedes nix-dotfiles (darwin) and guix-dotfiles' ad-hoc nix-home-manager flake (linux). See README.md/MIGRATION.md. --- users/ryan/common.nix | 180 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 users/ryan/common.nix (limited to 'users/ryan/common.nix') 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 @@ +{ config, pkgs, lib, ... }: + +{ + imports = [ ./modules/nvim ]; + + news.display = "silent"; + + # My own modules + ryan.neovim.enable = true; + + programs.starship = { + enable = true; + settings = { + add_newline = false; + character = { + success_symbol = "[➜](bold green)"; + error_symbol = "[➜](bold red)"; + }; + time = { + disabled = false; + format = "\[ $time \]($style)"; + time_format = "%T"; + }; + }; + }; + + # Package/platform overrides (darwinDefaultsId, package = null for homebrew, + # etc.) live in darwin.nix/linux.nix. Policies/profile are shared. + programs.zen-browser = { + enable = true; + policies = import ./zen/zenPolicies.nix; + profiles.default = import ./zen/zenProfile.nix; + }; + + programs.eza = { + enable = true; + enableZshIntegration = true; + }; + + programs.gpg.enable = true; + + programs.git = { + enable = true; + signing.signByDefault = true; + settings = { + user = { + name = "Ryan Schanzenbacher"; + email = "ryan@rschanz.org"; + }; + core.pager = "${pkgs.delta}/bin/delta"; + init.defaultBranch = "main"; + merge.conflictStyle = "zdiff3"; + interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only"; + delta = { + navigate = true; + side-by-side = true; + }; + # Merged from guix-dotfiles' ~/.gitconfig - git-lfs filter and + # git send-email settings, missing from the darwin config until now. + filter.lfs = { + clean = "git-lfs clean -- %f"; + smudge = "git-lfs smudge -- %f"; + process = "git-lfs filter-process"; + required = true; + }; + sendemail = { + smtpserver = "mail.rschanz.org"; + smtpuser = "ryan@rschanz.org"; + smtpencryption = "ssl"; + smtpserverport = 465; + }; + }; + }; + + programs.ssh = { + enable = true; + package = null; # installed by default + + enableDefaultConfig = false; + + settings = { + "rocApex" = { + hostname = "129.158.232.104"; + user = "root"; + }; + "hetzner" = { + hostname = "5.161.207.21"; + user = "root"; + }; + "rncorepub" = { + hostname = "5.161.89.186"; + user = "root"; + }; + # Merged from guix-dotfiles' ~/.ssh/config - hosts and quirks missing + # from the darwin config until now. + "linode" = { + hostname = "97.107.142.58"; + user = "root"; + }; + # `settings` has a freeform type, so upstream ssh_config directive + # names can be set directly - `programs.ssh.settings.*.extraOptions` + # is explicitly unsupported (hard assertion failure) in this HM version. + "192.168.216.1" = { + HostKeyAlgorithms = "+ssh-rsa"; + PubkeyAcceptedAlgorithms = "+ssh-rsa"; + }; + "*" = { + KexAlgorithms = "-sntrup761x25519-sha512@openssh.com"; + }; + }; + + # HM always renders the "*" block last regardless of dag order, so this + # trailing exec-only Match block (no directives of its own - position + # relative to the Host blocks above doesn't matter) is safe to append here. + # `settings."*"` above satisfies the assertion that gates using extraConfig. + extraConfig = '' + Match host * exec "gpg-connect-agent UPDATESTARTUPTTY /bye" + ''; + }; + + services.gpg-agent = { + enable = pkgs.stdenv.isLinux; + enableSshSupport = true; + }; + + programs.zsh = { + enable = true; + initContent = let + brewPath = if pkgs.stdenv.isDarwin && pkgs.stdenv.isAarch64 then '' + eval "$(/opt/homebrew/bin/brew shellenv)" + '' else ""; + in '' + export GPG_TTY="$(tty)" + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" + gpgconf --launch gpg-agent + gpg-connect-agent updatestartuptty /bye > /dev/null + ${brewPath} + ''; + shellAliases = { + cat = "bat --paging=never"; + diff = "delta"; + # Merged from guix-dotfiles' bash aliases (home-bash-service-type) - + # bash is being retired there in favor of this zsh config. `ls`/`spt`/ + # `python` are Linux-only (BSD ls on darwin doesn't take --color/-p, + # spotify_player and python3 aren't darwin things) - see linux.nix. + grep = "grep --color=auto"; + ll = "ls -l"; + rebuild = + if pkgs.stdenv.isDarwin + then "sudo darwin-rebuild switch --flake ~/.config/nix/." + else "home-manager switch --flake ~/.config/home-manager/#ryan"; + }; + }; + + # Shared across darwin and linux; the guix side already deferred these + # packages to nix (all commented out of home-configuration.scm's package + # list), same as the darwin config always has. + home.packages = with pkgs; [ + yt-dlp + aerc + gdu + taskwarrior3 + delta + kubectl + talhelper + talosctl + ]; + + xdg.configFile."aerc" = { + source = ./aerc; + recursive = true; + }; + + home.sessionVariables = { + XDG_CONFIG_HOME = "${config.home.homeDirectory}/.config"; + EDITOR = "${pkgs.neovim}/bin/nvim"; + }; + + programs.home-manager.enable = true; +} -- cgit v1.3.1