Change:
<del> { wxGTK, lib, stdenv, fetchurl, fetchFromGitHub, cmake, libGLU, libGL, zlib , libX11, gettext, glew, glm, cairo, curl, openssl, boost, pkgconfig , doxygen, pcre, libpthreadstubs, libXdmcp , wrapGAppsHook , oceSupport ? true, opencascade </del> <ins> { lib, stdenv, gnome3, pkgs, wxGTK30, wxGTK31 , gsettings-desktop-schemas, hicolor-icon-theme , callPackage, callPackages , librsvg, cups , pname ? "kicad" , oceSupport ? false, opencascade , withOCCT ? true, opencascade-occt </ins> , ngspiceSupport ? true, libngspice <del> , swig, python, pythonPackages , lndir </del> <ins> , scriptingSupport ? true, swig, python3, python3Packages , debug ? false, valgrind , with3d ? true , withI18n ? true </ins> }: assert ngspiceSupport -> libngspice != null; with lib; let <del> 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 { pname = "kicad"; series = "5.0"; version = "5.1.4"; src = fetchurl { url = "https://launchpad.net/kicad/${series}/${version}/+download/kicad-${version}.tar.xz"; sha256 = "1r60dgh6aalbpq1wsmpyxkz0nn4ck8ydfdjcrblpl69k5rks5k2j"; }; postPatch = '' substituteInPlace CMakeModules/KiCadVersion.cmake  --replace no-vcs-found ${version} ''; cmakeFlags = [ "-DKICAD_SCRIPTING=ON" "-DKICAD_SCRIPTING_MODULES=ON" "-DKICAD_SCRIPTING_WXPYTHON=ON" # nix installs wxPython headers in wxPython package, not in wxwidget # as assumed. We explicitely set the header location. "-DCMAKE_CXX_FLAGS=-I${pythonPackages.wxPython}/include/wx-3.0" "-DwxPYTHON_INCLUDE_DIRS=${pythonPackages.wxPython}/include/wx-3.0" ] ++ optionals (oceSupport) [ "-DKICAD_USE_OCE=ON" "-DOCE_DIR=${opencascade}" ] ++ optional (ngspiceSupport) "-DKICAD_SPICE=ON"; nativeBuildInputs = [ cmake doxygen pkgconfig wrapGAppsHook pythonPackages.wrapPython lndir ]; pythonPath = [ pythonPackages.wxPython ]; propagatedBuildInputs = [ pythonPackages.wxPython ]; buildInputs = [ libGLU libGL zlib libX11 wxGTK pcre libXdmcp glew glm libpthreadstubs cairo curl openssl boost swig (python.withPackages (ps: with ps; [ wxPython ])) ] ++ optional (oceSupport) opencascade ++ optional (ngspiceSupport) libngspice; # this breaks other applications in kicad dontWrapGApps = true; passthru = { i18n = mkLib version "i18n" "1dk7wis4cncmihl8fnic3jyhqcdzpifchzsp7hmf214h0vp199zr" { buildInputs = [ gettext ]; meta.license = licenses.gpl2; # https://github.com/KiCad/kicad-i18n/issues/3 }; symbols = mkLib version "symbols" "1lna4xlvzrxif3569pkp6mrg7fj62z3a3ri5j97lnmnnzhiddnh3" { meta.license = licenses.cc-by-sa-40; }; footprints = mkLib version "footprints" "0c0kcywxlaihzzwp9bi0dsr2v9j46zcdr85xmfpivmrk19apss6a" { meta.license = licenses.cc-by-sa-40; }; templates = mkLib version "templates" "1bagb0b94cjh7zp9z0h23b60j45kwxbsbb7b2bdk98dmph8lmzbb" { meta.license = licenses.cc-by-sa-40; </del> <ins> stable = pname != "kicad-unstable"; baseName = if (stable) then "kicad" else "kicad-unstable"; versions = { "kicad" = { kicadVersion = { version = "5.1.5"; src.sha256 = "15h3rwisjss3fdc9bam9n2wq94slhacc3fbg14bnzf4n5agsnv5b"; }; libVersion = { version = "5.1.5"; libSources = { i18n.sha256 = "1rfpifl8vky1gba2angizlb2n7mwmsiai3r6ip6qma60wdj8sbd3"; symbols.sha256 = "048b07ffsaav1ssrchw2p870lvb4rsyb5vnniy670k7q9p16qq6h"; templates.sha256 = "0cs3bm3zb5ngw5ldn0lzw5bvqm4kvcidyrn76438alffwiz2b15g"; footprints.sha256 = "1c4whgn14qhz4yqkl46w13p6rpv1k0hsc9s9h9368fxfcz9knb2j"; packages3d.sha256 = "0cff2ms1bsw530kqb1fr1m2pjixyxzwa81mxgac3qpbcf8fnpvaz"; }; }; </ins> }; <del> packages3d = mkLib version "packages3d" "0h2qjj8vf33jz6jhqdz90c80h5i1ydgfqnns7rn0fqphlnscb45g" { hydraPlatforms = []; # this is a ~1 GiB download, occupies ~5 GiB in store meta.license = licenses.cc-by-sa-40; </del> <ins> "kicad-unstable" = { kicadVersion = { version = "2019-12-31"; src = { rev = "eaaa4eb63acb289047dfbb6cc275579dea58f12b"; sha256 = "1v2hf2slphjdh14y56pmzlpi6mqidrd8198if1fi0cch72v37zch"; }; }; libVersion = { version = "unstable"; libSources = { i18n.rev = "e7439fd76f27cfc26e269c4e6c4d56245345c28b"; i18n.sha256 = "1nqm1kx5b4f7s0f9q8bg4rdhqnp0128yp6bgnrkia1kwmfnf5gmy"; symbols.rev = "1bc5ff11c76bcbfda227e534b0acf737edddde8f"; symbols.sha256 = "05kv93790wi4dpbn2488p587b83yz1zw9h62lkv41h7vn2r1mmb7"; templates.rev = "0c0490897f803ab8b7c3dad438b7eb1f80e0417c"; templates.sha256 = "0cs3bm3zb5ngw5ldn0lzw5bvqm4kvcidyrn76438alffwiz2b15g"; footprints.rev = "454126c125edd3fa8633f301421a7d9c4de61b77"; footprints.sha256 = "00nli4kx2i68bk852rivbirzcgpsdlpdk34g1q892952jsbh7fy6"; packages3d.rev = "c2b92a411adc93ddeeed74b36b542e1057f81a2a"; packages3d.sha256 = "05znc6y2lc31iafspg308cxdda94zg6c7mwslmys76npih1pb8qc"; }; }; </ins> }; }; <ins> versionConfig = versions.${baseName}; wxGTK = if (stable) # wxGTK3x may default to withGtk2 = false, see #73145 then wxGTK30.override { withGtk2 = false; } # wxGTK31 currently introduces an issue with opening the python interpreter in pcbnew # but brings high DPI support? else wxGTK31.override { withGtk2 = false; }; pythonPackages = python3Packages; python = python3; wxPython = python3Packages.wxPython_4_0; kicad-libraries = callPackages ./libraries.nix versionConfig.libVersion; kicad-base = callPackage ./base.nix { pname = baseName; inherit versions stable baseName; inherit wxGTK python wxPython; inherit debug withI18n withOCCT oceSupport ngspiceSupport scriptingSupport; }; in stdenv.mkDerivation rec { inherit pname; version = versions.${baseName}.kicadVersion.version; src = kicad-base; dontUnpack = true; dontConfigure = true; dontBuild = true; dontFixup = true; pythonPath = optionals (scriptingSupport) [ wxPython pythonPackages.six ]; nativeBuildInputs = optionals (scriptingSupport) [ pythonPackages.wrapPython ]; </ins> <del> modules = with passthru; [ i18n symbols footprints templates ]; </del> <ins> # wrapGAppsHook added the equivalent to ${kicad-base}/share # though i noticed no difference without it makeWrapperArgs = [ "--prefix XDG_DATA_DIRS : ${kicad-base}/share" "--prefix XDG_DATA_DIRS : ${hicolor-icon-theme}/share" "--prefix XDG_DATA_DIRS : ${gnome3.defaultIconTheme}/share" "--prefix XDG_DATA_DIRS : ${wxGTK.gtk}/share/gsettings-schemas/${wxGTK.gtk.name}" "--prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}" # wrapGAppsHook did these two as well, no idea if it matters... "--prefix XDG_DATA_DIRS : ${cups}/share" "--prefix GIO_EXTRA_MODULES : ${gnome3.dconf}/lib/gio/modules" </ins> <del> postInstall = '' mkdir -p $out/share for module in $modules; do lndir $module/share $out/share done ''; </del> <ins> "--set KISYSMOD ${kicad-libraries.footprints}/share/kicad/modules" "--set KICAD_SYMBOL_DIR ${kicad-libraries.symbols}/share/kicad/library" "--set KICAD_TEMPLATE_DIR ${kicad-libraries.templates}/share/kicad/template" "--prefix KICAD_TEMPLATE_DIR : ${kicad-libraries.symbols}/share/kicad/template" "--prefix KICAD_TEMPLATE_DIR : ${kicad-libraries.footprints}/share/kicad/template" ] ++ optionals (with3d) [ "--set KISYS3DMOD ${kicad-libraries.packages3d}/share/kicad/modules/packages3d" ] ++ optionals (ngspiceSupport) [ "--prefix LD_LIBRARY_PATH : ${libngspice}/lib" ] </ins> <del> preFixup = '' buildPythonPath "$out $pythonPath" gappsWrapperArgs+=(--set PYTHONPATH "$program_PYTHONPATH") </del> <ins> # infinisil's workaround for #39493 ++ [ "--set GDK_PIXBUF_MODULE_FILE ${librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" ] ; </ins> <del> wrapGApp "$out/bin/kicad" --prefix LD_LIBRARY_PATH : "${libngspice}/lib" ''; </del> <ins> # dunno why i have to add $makeWrapperArgs manually... # $out and $program_PYTHONPATH don't exist when makeWrapperArgs gets set? # not sure if anything has to be done with the other stuff in kicad-base/bin # dxf2idf, idf2vrml, idfcyl, idfrect, kicad2step, kicad-ogltest installPhase = optionalString (scriptingSupport) '' buildPythonPath "${kicad-base} $pythonPath" '' + '' makeWrapper ${kicad-base}/bin/kicad $out/bin/kicad $makeWrapperArgs '' + optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH" '' + '' makeWrapper ${kicad-base}/bin/pcbnew $out/bin/pcbnew $makeWrapperArgs '' + optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH" '' + '' makeWrapper ${kicad-base}/bin/eeschema $out/bin/eeschema $makeWrapperArgs '' + optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH" '' + '' makeWrapper ${kicad-base}/bin/gerbview $out/bin/gerbview $makeWrapperArgs '' + optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH" '' + '' makeWrapper ${kicad-base}/bin/pcb_calculator $out/bin/pcb_calculator $makeWrapperArgs '' + optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH" '' + '' makeWrapper ${kicad-base}/bin/pl_editor $out/bin/pl_editor $makeWrapperArgs '' + optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH" '' + '' makeWrapper ${kicad-base}/bin/bitmap2component $out/bin/bitmap2component $makeWrapperArgs '' + optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH" '' ; </ins> meta = { <del> description = "Free Software EDA Suite"; homepage = http://www.kicad-pcb.org/; license = licenses.gpl2; maintainers = with maintainers; [ berce ]; </del> <ins> description = if (stable) then "Open Source Electronics Design Automation Suite" else "Open Source EDA Suite, Development Build"; homepage = "https://www.kicad-pcb.org/"; longDescription = '' KiCad is an open source software suite for Electronic Design Automation. The Programs handle Schematic Capture, and PCB Layout with Gerber output. ''; license = licenses.agpl3; # berce seems inactive... maintainers = with maintainers; [ evils kiwi berce ]; # kicad's cross-platform, not sure what to fill in here </ins> platforms = with platforms; linux; <del> broken = stdenv.isAarch64; </del> }; }

Discussion:
Describe the bug As originally reported by on IRC: Kicad's pcbnew segfaults without indication of reason, when searching for a footprint. To Reproduce Steps to reproduce the behaviour: -Footprint -click in the workspace -search for "dip 14" (this term seems very reliable in inducing the issue, but is not guaranteed to work every time) a segmentation fault. Expected behaviour Search should return a list of footprints matching the term, with a preview of the top result. Additional context on IRC was unable to reproduce the issue on the same package (same hash) Metadata Maintainer information: i am unsure what to fill in here CC though they seem inactive, they're listed as the maintainer Things tried Fix all the warnings that occurred between starting pcbnew and the segmentation fault Use python3 Tried wxGTK31 (introduced another issue but didn't solve this one) Added a debug build option and had a look at it with all . I also tried kicad from nix on debian, this fails as well, but immediately on starting pcbnew, with a bunch of fontconfig warnings and errors followed by and segmentation fault, this is probably a separate issue. And i asked on IRC #kicad, someone else reported having this issue on debian10 when using xfwm. (i use )
I have (at this time) only one thing to add. If you manage to place a footprint successfully, either by not searching and instead scrolling through the list to the one you want, or if it happens to be a rare time it doesn't crash while searching; I don't think I've had any experiences where it did not crash on the next action, give or take. I'm quite confident I've never been able to place 2. If I have I wasn't able to save before it did crash, that's for sure :<
I've submitted a . I'm not sure this will fix your issue, but might be worth giving it a shot.
thanks for letting me know it unfortunately does not fix this issue

I'm trying to add some 3D models to my footprints, but they do not show up in the 3D viewer. I've tried a custom model as well as the ones installed with KiCAD. I don't see any messages on stdout or stderr other than: the footprint editor a footprint that has an associated model that the 3D model doesn't render
I'm also seeing this. It appears the issue is that 3D model importation is implemented via plugins which are shared libraries. These are found in . However, the code which searches for these plugins () makes assumptions which don't hold for NixOS. Thus, the search attempt fails, as shown by strace: A temporary workaround is as follows, which uses the user-local search path: This hack will need fixing whenever kicad is updated, of course. cc
This had been fixed in 5.1.0: We should close this issue after having updated the package and tested.
This should work now with the new package. Edit: see PR .
you may need to so it'll update the paths there on the next start (or do so manually)