Change:
KISYSMOD and KISYS3DMOD point to missing directories. On my system they are and , respectively. Neither of these paths exist though. I do see a few other kicad-5.0.0 directories in the Nix store, but I'm not sure if I should use those (and if so, which one). the environment variables (Preferences Configure Paths...)
The library is also supposed to be at which does not exist while points to it.
Mostly fixed by . Symbols and footprints are now included, and the variables point to the correct location. We don't have the 3D models by default as they're five gigabytes, for that you need to use the derivation (which unfortunately means recompiling kicad for now).

Discussion:
<del> { wxGTK, lib, stdenv, fetchurl, cmake, libGLU_combined, zlib </del> <ins> { wxGTK, lib, stdenv, fetchurl, fetchFromGitHub, cmake, libGLU_combined, zlib </ins> , libX11, gettext, glew, glm, cairo, curl, openssl, boost, pkgconfig , doxygen, pcre, libpthreadstubs, libXdmcp , wrapGAppsHook , oceSupport ? true, opencascade , ngspiceSupport ? true, libngspice , swig, python, pythonPackages <ins> , lndir </ins> }: assert ngspiceSupport -> libngspice != null; with lib; <del> stdenv.mkDerivation rec { </del> <ins> let mkLib = version: name: sha256: attrs: stdenv.mkDerivation ({ name = "kicad-${name}-${version}"; src = fetchFromGitHub { owner = "KiCad"; repo = "kicad-${name}"; rev = "${version}"; inherit sha256 name; }; nativeBuildInputs = [ cmake ]; } // attrs); in stdenv.mkDerivation rec { </ins> name = "kicad-${version}"; series = "5.0"; version = "5.0.2";

pkgconfig wrapGAppsHook pythonPackages.wrapPython <ins> lndir </ins> ]; pythonPath = [ pythonPackages.wxPython ]; propagatedBuildInputs = [ pythonPackages.wxPython ]; buildInputs = [ <del> libGLU_combined zlib libX11 wxGTK pcre libXdmcp gettext glew glm libpthreadstubs </del> <ins> libGLU_combined zlib libX11 wxGTK pcre libXdmcp glew glm libpthreadstubs </ins> cairo curl openssl boost swig python ] ++ optional (oceSupport) opencascade

# this breaks other applications in kicad dontWrapGApps = true; <ins> passthru = { i18n = mkLib version "i18n" "1hkc240gymhmyv6r858mq5d2slz0vjqc47ah8wn82vvmb83fpnjy" { buildInputs = [ gettext ]; meta.license = licenses.gpl2; # https://github.com/KiCad/kicad-i18n/issues/3 }; symbols = mkLib version "symbols" "1rjh2pjcrc3bhcgyyskj5pssm7vffrjk0ymwr70fb7sjpmk96yjk" { meta.license = licenses.cc-by-sa-40; }; footprints = mkLib version "footprints" "19khqyrbrqsdzxvm1b1vxfscxhss705fqky0ilrbvnbvf27fnx8w" { meta.license = licenses.cc-by-sa-40; }; templates = mkLib version "templates" "0rlzq1n09n0sf2kj5c9bvbnkvs6cpycjxmxwcswql0fbpcp0sql7" { meta.license = licenses.cc-by-sa-40; }; packages3d = mkLib version "packages3d" "135jyrljgknnv2y35skhnwcxg16yxxkfbcx07nad3vr4r76zk3am" { hydraPlatforms = []; # this is a ~1 GiB download, occupies ~5 GiB in store meta.license = licenses.cc-by-sa-40; }; }; modules = with passthru; [ i18n symbols footprints templates ]; postInstall = '' mkdir -p $out/share for module in $modules; do lndir $module/share $out/share done ''; </ins> preFixup = '' buildPythonPath "$out $pythonPath" gappsWrapperArgs+=(--set PYTHONPATH "$program_PYTHONPATH")

wxGTK = wxGTK30; boost = boost160; }; <ins> kicad-with-packages3d = kicad.overrideAttrs (old: { modules = old.modules ++ [ old.passthru.packages3d ]; }); </ins> kicad-unstable = python.pkgs.callPackage ../applications/science/electronics/kicad/unstable.nix { wxGTK = wxGTK30;