I am running NixOS on WSL
I use nix version nix 2.18.1 I run
nix develop
in the directory containing flake.nix that looks like that:
{
description = "Python environment with ollama";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
jina-hubble-sdk = with pkgs.python3Packages;
buildPythonPackage rec {
pname = "jina-hubble-sdk";
version = "0.39.0";
src = pkgs.fetchPypi {
inherit pname version;
sha256 = "9021417794a6d3cf3fad8a880cf668a3a986b9d53d5be5fa391aae1767a5b9b0";
};
nativeBuildInputs = [
poetry-core
pkgs.dos2unix # Add dos2unix to convert line endings
];
propagatedBuildInputs = [
pep517
pip
requests
aiohttp
rich
importlib-metadata
filelock
pathspec
docker
pyyaml
python-jose
];
# Convert line endings to Unix-style
preConfigure = ''
export HOME=$(mktemp -d)
'';
# put this code inside preConfigure if you want to run it dos2unix -f /nix/store/v099hqvw5z87423p4hz1vfhzaqa07dii-stdenv-linux/setup
};
pythonEnv = pkgs:
pkgs.python3.withPackages (ps:
with ps; [
jina-hubble-sdk
]);
in {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
curl
ollama
(pythonEnv pkgs)
];
};
});
}
and I get the following error
error: builder for ‘/nix/store/dm6cxw020s7whbfgqj8jivd3dv1pby0i-python3.11-jina-hubble-sdk-0.39.0.drv’ failed with exit code 127; last 10 log lines: > Using setuptoolsCheckPhase > Running phase: unpackPhase > unpacking source archive /nix/store/9q6b5l6955sabgvk8ah5xx0sfji25zmn-jina-hubble-sdk-0.39.0.tar.gz > source root is jina-hubble-sdk-0.39.0 > setting SOURCE_DATE_EPOCH to timestamp 1688549032 of file jina-hubble-sdk-0.39.0/setup.cfg > Running phase: patchPhase > Running phase: updateAutotoolsGnuConfigScriptsPhase > Running phase: configurePhase > /nix/store/v099hqvw5z87423p4hz1vfhzaqa07dii-stdenv-linux/setup: line 114: $‘\r’: command not found > /nix/store/v099hqvw5z87423p4hz1vfhzaqa07dii-stdenv-linux/setup: line 131: pop_var_context: head of shell_variables not a function context For full logs, run ‘nix-store -l /nix/store/dm6cxw020s7whbfgqj8jivd3dv1pby0i-python3.11-jina-hubble-sdk-0.39.0.drv’. error: 1 dependencies of derivation ‘/nix/store/25gl4f29rr56ci1h5k53wmm7wgfmk2p2-python3-3.11.8-env.drv’ failed to build error: 1 dependencies of derivation ‘/nix/store/pxkgnl5nx66fcdi1rkvz86kbfrvlmhn2-nix-shell-env.drv’ failed to build
But when I asked for help on stackoverflow, somebody say that this problem don’t occur on his computer and he is using nixos with WSL too.
Hence my question, why is causing this flake not to run correctly on my computer when it works for others ?