Skip to content

Commit 3d39fc8

Browse files
stackptrclaude
andauthored
refactor: generalize nix-eval-flake into nix-flake wrapper (#336)
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 <subcommand> <flake-output> [extra-args...] Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 15e602d commit 3d39fc8

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎modules/home/development.nix‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ in {
9090
"Bash(nix show-derivation *)"
9191
"Bash(nix store *)"
9292
"Bash(nix why-depends *)"
93-
"Bash(nix-eval-flake *)"
93+
"Bash(nix-flake *)"
9494
# Git
9595
"Bash(git add *)"
9696
"Bash(git blame *)"

‎modules/home/utilities.nix‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ in {
9191
programs.nix-index-database.comma.enable = true;
9292

9393
home.packages = let
94-
nix-eval-flake = pkgs.writeShellScriptBin "nix-eval-flake" ''
95-
nix eval ".#$1" "''${@:2}"
94+
nix-flake = pkgs.writeShellScriptBin "nix-flake" ''
95+
nix "$1" ".#$2" "''${@:3}"
9696
'';
9797
in
9898
[
99-
nix-eval-flake
99+
nix-flake
100100
pkgs.manix
101101
pkgs.nix-du
102102
pkgs.nix-tree

0 commit comments

Comments
 (0)