From 458778c860facca9c480f296f4676e7f41c3530a Mon Sep 17 00:00:00 2001 From: Harivansh Rathi Date: Mon, 30 Mar 2026 14:44:41 -0400 Subject: [PATCH] fix formatting --- home/netty-worktree.nix | 8 ++-- home/netty.nix | 3 +- home/scripts.nix | 10 +++-- home/zsh.nix | 85 ++++++++++++++++++++--------------------- scripts/default.nix | 39 ++++++++++++------- 5 files changed, 80 insertions(+), 65 deletions(-) diff --git a/home/netty-worktree.nix b/home/netty-worktree.nix index e7890e9..ed39fcd 100644 --- a/home/netty-worktree.nix +++ b/home/netty-worktree.nix @@ -3,9 +3,11 @@ lib, pkgs, ... -}: let - customScripts = import ../scripts {inherit config lib pkgs;}; -in { +}: +let + customScripts = import ../scripts { inherit config lib pkgs; }; +in +{ home.packages = builtins.attrValues customScripts.nettyPackages; programs.zsh.initContent = lib.mkAfter '' diff --git a/home/netty.nix b/home/netty.nix index 066b82e..826456f 100644 --- a/home/netty.nix +++ b/home/netty.nix @@ -1,4 +1,5 @@ -{...}: { +{ ... }: +{ imports = [ ./common.nix ./netty-worktree.nix diff --git a/home/scripts.nix b/home/scripts.nix index a62e465..a3a8f94 100644 --- a/home/scripts.nix +++ b/home/scripts.nix @@ -3,14 +3,16 @@ lib, pkgs, ... -}: let - customScripts = import ../scripts {inherit config lib pkgs;}; -in { +}: +let + customScripts = import ../scripts { inherit config lib pkgs; }; +in +{ home.packages = builtins.attrValues customScripts.commonPackages ++ lib.optionals pkgs.stdenv.isDarwin (builtins.attrValues customScripts.darwinPackages); - home.activation.initializeThemeState = lib.hm.dag.entryAfter ["writeBoundary"] '' + home.activation.initializeThemeState = lib.hm.dag.entryAfter [ "writeBoundary" ] '' mkdir -p "${customScripts.theme.paths.stateDir}" "${customScripts.theme.paths.fzfDir}" "${customScripts.theme.paths.ghosttyDir}" "${customScripts.theme.paths.tmuxDir}" if [[ -f "${customScripts.theme.paths.stateFile}" ]]; then diff --git a/home/zsh.nix b/home/zsh.nix index be01baa..0c23065 100644 --- a/home/zsh.nix +++ b/home/zsh.nix @@ -3,14 +3,15 @@ lib, pkgs, ... -}: { +}: +{ home.file.".oh-my-zsh/custom/themes/agnoster.zsh-theme".source = ../config/agnoster.zsh-theme; - home.activation.ensureOhMyZshCache = lib.hm.dag.entryAfter ["writeBoundary"] '' + home.activation.ensureOhMyZshCache = lib.hm.dag.entryAfter [ "writeBoundary" ] '' mkdir -p "${config.xdg.cacheHome}/oh-my-zsh" ''; - home.packages = [pkgs.oh-my-zsh]; + home.packages = [ pkgs.oh-my-zsh ]; programs.zsh = { enable = true; @@ -21,42 +22,40 @@ autosuggestion.enable = true; syntaxHighlighting.enable = true; - shellAliases = - { - co = "codex --dangerously-bypass-approvals-and-sandbox"; - ca = "cursor-agent"; - cc = "claude"; - ch = "claude-handoff"; - cl = "clear"; - gc = "git commit"; - gd = "git diff"; - gk = "git checkout"; - gp = "git push"; - gpo = "git pull origin"; - gs = "git status"; - ld = "lumen diff"; - lg = "lazygit"; - nim = "nvim ."; - } - // lib.optionalAttrs pkgs.stdenv.isDarwin { - tailscale = "/Applications/Tailscale.app/Contents/MacOS/Tailscale"; - }; + shellAliases = { + co = "codex --dangerously-bypass-approvals-and-sandbox"; + ca = "cursor-agent"; + cc = "claude"; + ch = "claude-handoff"; + cl = "clear"; + gc = "git commit"; + gd = "git diff"; + gk = "git checkout"; + gp = "git push"; + gpo = "git pull origin"; + gs = "git status"; + ld = "lumen diff"; + lg = "lazygit"; + nim = "nvim ."; + } + // lib.optionalAttrs pkgs.stdenv.isDarwin { + tailscale = "/Applications/Tailscale.app/Contents/MacOS/Tailscale"; + }; - envExtra = - '' - if [[ -f "$HOME/.cargo/env" ]]; then - . "$HOME/.cargo/env" - fi - export NODE_NO_WARNINGS=1 - '' - + lib.optionalString pkgs.stdenv.isDarwin '' - # Ghostty shell integration expects a resource directory; the Nix app - # bundle lives in the store instead of /Applications. - export GHOSTTY_RESOURCES_DIR="${pkgs.ghostty-bin}/Applications/Ghostty.app/Contents/Resources/ghostty" - '' - + '' - export MANPAGER="nvim +Man!" - ''; + envExtra = '' + if [[ -f "$HOME/.cargo/env" ]]; then + . "$HOME/.cargo/env" + fi + export NODE_NO_WARNINGS=1 + '' + + lib.optionalString pkgs.stdenv.isDarwin '' + # Ghostty shell integration expects a resource directory; the Nix app + # bundle lives in the store instead of /Applications. + export GHOSTTY_RESOURCES_DIR="${pkgs.ghostty-bin}/Applications/Ghostty.app/Contents/Resources/ghostty" + '' + + '' + export MANPAGER="nvim +Man!" + ''; initContent = lib.mkMerge [ (lib.mkOrder 550 '' @@ -87,9 +86,7 @@ export BUN_INSTALL="$HOME/.bun" export PNPM_HOME="${ - if pkgs.stdenv.isDarwin - then "$HOME/Library/pnpm" - else "${config.xdg.dataHome}/pnpm" + if pkgs.stdenv.isDarwin then "$HOME/Library/pnpm" else "${config.xdg.dataHome}/pnpm" }" bindkey -v typeset -U path PATH @@ -106,9 +103,9 @@ "/run/current-system/sw/bin" "/nix/var/nix/profiles/default/bin" ${lib.optionalString pkgs.stdenv.isDarwin '' - "/opt/homebrew/bin" - "/opt/homebrew/sbin" - ''} + "/opt/homebrew/bin" + "/opt/homebrew/sbin" + ''} $path ) diff --git a/scripts/default.nix b/scripts/default.nix index 5cd7a12..6313cdf 100644 --- a/scripts/default.nix +++ b/scripts/default.nix @@ -2,20 +2,22 @@ config, lib, pkgs, -}: let - theme = import ../lib/theme.nix {inherit config;}; +}: +let + theme = import ../lib/theme.nix { inherit config; }; tmuxConfigs = { dark = pkgs.writeText "tmux-theme-dark.conf" (theme.renderTmux "dark"); light = pkgs.writeText "tmux-theme-light.conf" (theme.renderTmux "light"); }; - mkScript = { - file, - name, - runtimeInputs ? [], - replacements ? {}, - }: + mkScript = + { + file, + name, + runtimeInputs ? [ ], + replacements ? { }, + }: pkgs.writeShellApplication { inherit name runtimeInputs; text = lib.replaceStrings (builtins.attrNames replacements) (builtins.attrValues replacements) ( @@ -27,7 +29,7 @@ ga = mkScript { name = "ga"; file = ./ga.sh; - runtimeInputs = with pkgs; [git]; + runtimeInputs = with pkgs; [ git ]; }; ghpr = mkScript { @@ -71,7 +73,7 @@ ni = mkScript { name = "ni"; file = ./ni.sh; - runtimeInputs = with pkgs; [nix]; + runtimeInputs = with pkgs; [ nix ]; }; theme = mkScript { @@ -115,7 +117,11 @@ wt = mkScript { name = "wt"; file = ./wt.sh; - runtimeInputs = with pkgs; [coreutils git gnused]; + runtimeInputs = with pkgs; [ + coreutils + git + gnused + ]; }; wt-create = mkScript { @@ -123,8 +129,15 @@ file = ./wt-create.sh; }; }; -in { - inherit commonPackages darwinPackages nettyPackages theme tmuxConfigs; +in +{ + inherit + commonPackages + darwinPackages + nettyPackages + theme + tmuxConfigs + ; packages = commonPackages; }