From fe0ebf90118fc41ebe2c2c629209f34e0a9e0639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Mon, 14 Oct 2024 13:50:24 +0200 Subject: [PATCH] chore(nix): make sure ruff is runnable on NixOS 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. --- devenv.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/devenv.nix b/devenv.nix index 6cf2d3264d..2286c4ef9c 100644 --- a/devenv.nix +++ b/devenv.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ lib, pkgs, ... }: # https://devenv.sh/reference/options/ { @@ -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" ]; + }; + }; }