From a987e6b6892737e88be9b390e4f9dd38a3110eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey?= Date: Mon, 9 Mar 2026 12:26:01 -0700 Subject: [PATCH] refactor: generalize nix-eval-flake into nix-flake wrapper Replace the nix-eval-flake wrapper (which only supported `nix eval`) with a generalized nix-flake wrapper that accepts any nix subcommand. This avoids the `#` character in flake refs causing permission prompts in Claude Code for commands like `nix build .#...`. Usage: nix-flake [extra-args...] Co-Authored-By: Claude Opus 4.6 --- modules/home/development.nix | 2 +- modules/home/utilities.nix | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/home/development.nix b/modules/home/development.nix index 9fdc6c0..086f013 100644 --- a/modules/home/development.nix +++ b/modules/home/development.nix @@ -90,7 +90,7 @@ in { "Bash(nix show-derivation *)" "Bash(nix store *)" "Bash(nix why-depends *)" - "Bash(nix-eval-flake *)" + "Bash(nix-flake *)" # Git "Bash(git add *)" "Bash(git blame *)" diff --git a/modules/home/utilities.nix b/modules/home/utilities.nix index bef9042..27fee57 100644 --- a/modules/home/utilities.nix +++ b/modules/home/utilities.nix @@ -91,12 +91,12 @@ in { programs.nix-index-database.comma.enable = true; home.packages = let - nix-eval-flake = pkgs.writeShellScriptBin "nix-eval-flake" '' - nix eval ".#$1" "''${@:2}" + nix-flake = pkgs.writeShellScriptBin "nix-flake" '' + nix "$1" ".#$2" "''${@:3}" ''; in [ - nix-eval-flake + nix-flake pkgs.manix pkgs.nix-du pkgs.nix-tree