summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorAAGaming <aagaming@riseup.net>2024-07-03 20:25:37 -0400
committerAAGaming <aagaming@riseup.net>2024-07-03 20:25:37 -0400
commit83972972f306617b414204d4ff095ca7c0e318f4 (patch)
treefbd6cc0e3b8ab2a0c0993baed5393becfb706247 /flake.nix
parent2c4edeb810d740abfacc0dbded7626f9323ade77 (diff)
downloaddecky-loader-83972972f306617b414204d4ff095ca7c0e318f4.tar.gz
decky-loader-83972972f306617b414204d4ff095ca7c0e318f4.zip
allow direnv to change vscode python path when updating
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/flake.nix b/flake.nix
index be6b5631..fb8e6ee7 100644
--- a/flake.nix
+++ b/flake.nix
@@ -26,13 +26,12 @@
});
}).env.overrideAttrs (oldAttrs: {
shellHook = ''
- set -o noclobber
PYTHONPATH=`which python`
FILE=.vscode/settings.json
if [ -f "$FILE" ]; then
- echo "$FILE already exists, not writing interpreter path to it."
+ jq --arg pythonpath "$PYTHONPATH" '.["python.defaultInterpreterPath"] = $pythonpath' $FILE > "$FILE.tmp" && mv "$FILE.tmp" "$FILE"
else
- echo "{\"python.defaultInterpreterPath\": \"''${PYTHONPATH}\"}" > "$FILE"
+ echo "{\"python.defaultInterpreterPath\": \"$PYTHONPATH\"}" > "$FILE"
fi
'';
UV_USE_IO_URING = 0; # work around node#48444
@@ -40,6 +39,7 @@
nodejs_22
nodePackages.pnpm
poetry
+ jq
# fixes local pyright not being able to see the pythonpath properly.
(pkgs.writeShellScriptBin "pyright" ''
${pkgs.pyright}/bin/pyright --pythonpath `which python3` "$@" '')