I’m trying to run trelby, some screenwriting software. I actually bricked my Ubuntu install when trying to set this up there because wxPython didn’t install, I tried creating venvs and that didn’t work either, and I ended up trying to delete Python entirely… So I ended up here.

I cloned the repo, set up a shell.nix with the required packages, and am now stuck with the same problem I had before: wxPython doesn’t install.

More info
# shell.nix
let
  # We pin to a specific nixpkgs commit for reproducibility.
  # Last updated: 2024-04-29. Check for new commits at https://status.nixos.org/.
  pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/cf8cc1201be8bc71b7cbbbdaf349b22f4f99c7ae.tar.gz") {};
in pkgs.mkShell {
  packages = [
    (pkgs.python3.withPackages (python-pkgs: with python-pkgs; [
      # select Python packages here
      setuptools
      wxPython
      lxml
      reportlab
      pytest
    ]))
  ];
}

Output from attempting to run nix-shell:

unpacking 'https://github.com/NixOS/nixpkgs/archive/cf8cc1201be8bc71b7cbbbdaf349b22f4f99c7ae.tar.gz' into the Git cache...
error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       … while evaluating derivation 'nix-shell'
         whose name attribute is located at /nix/store/4ab6vrcph07w6ra79bc04fy8bbcmb9r0-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'nativeBuildInputs' of derivation 'nix-shell'
         at /nix/store/4ab6vrcph07w6ra79bc04fy8bbcmb9r0-source/pkgs/stdenv/generic/make-derivation.nix:375:7:
          374|       depsBuildBuild              = elemAt (elemAt dependencies 0) 0;
          375|       nativeBuildInputs           = elemAt (elemAt dependencies 0) 1;
             |       ^
          376|       depsBuildTarget             = elemAt (elemAt dependencies 0) 2;

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: undefined variable 'wxPython'
       at /home/edwinc/Documents/code/trelby/shell.nix:11:7:
           10|       setuptools
           11|       wxPython
             |       ^
           12|       lxml

Cheers!

Edit: solved! Just change the wxPython to wxpython on the shell.nix file, and probably also change the manual fetch from an outdated repo to <nixpkgs> as @[email protected] recommended.

  • FunkyStuff [he/him]@hexbear.netOP
    link
    fedilink
    English
    arrow-up
    2
    ·
    5 days ago

    I’m doing some homework so I haven’t tried what hello_hello said (not looking forward to figuring out how to do everything on Docker, since it was far from trivial even setting it up on Ubuntu). Thanks.

    • hello_hello [comrade/them]@hexbear.netM
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      5 days ago

      There are prebuilt binaries on their website, you dont have to compile trelby from source on your own.

      I just mentioned docker/containers because it’s a way to escape NixOS FHS incompatability and get back to a standard Linux environment.

      I’m surprised that trelby isnt packaged in NixOS, maybe someone will get on that.

      • FunkyStuff [he/him]@hexbear.netOP
        link
        fedilink
        English
        arrow-up
        2
        ·
        5 days ago

        Yeah you’re absolutely right, I had tried that website 2 days ago but my “spot the download button” skills failed and I had ended up downloading the source code; I ended up thinking the source code was all they had, no binary release.