Skip to content

Commit

Permalink
chore(nix): make sure ruff is runnable on NixOS
Browse files Browse the repository at this point in the history
Before `devenv`'s been introduced, `autoPatchelfHook` made sure that
external binaries are executable. `Devenv` has its own magic sauce
that makes Python dependencies "just work", however `ruff` is not a
python binary, so it needs special care.
  • Loading branch information
vlaci committed Oct 14, 2024
1 parent d26ae04 commit fe0ebf9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion devenv.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ lib, pkgs, ... }:

# https://devenv.sh/reference/options/
{
Expand All @@ -24,4 +24,12 @@
nvfetcher
]
++ unblob.runtimeDeps;

tasks = {
"venv:patchelf" = {
exec = "${lib.getExe pkgs.patchelf} --set-interpreter ${pkgs.stdenv.cc.bintools.dynamicLinker} $VIRTUAL_ENV/bin/ruff";
after = [ "devenv:python:poetry" ];
before = [ "devenv:enterShell" ];
};
};
}

0 comments on commit fe0ebf9

Please sign in to comment.