{"id":13627074,"url":"https://github.com/vinszent/cq-flake","last_synced_at":"2025-07-12T01:31:35.070Z","repository":{"id":37428781,"uuid":"297057389","full_name":"vinszent/cq-flake","owner":"vinszent","description":"CadQuery and CQ-editor flake, closely follows master","archived":false,"fork":false,"pushed_at":"2025-06-30T14:26:19.000Z","size":183,"stargazers_count":37,"open_issues_count":6,"forks_count":26,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-06-30T15:35:00.416Z","etag":null,"topics":["cadquery","cq-editor","flake","nix","nix-flake","nixos"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vinszent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-20T11:03:40.000Z","updated_at":"2025-06-30T14:25:15.000Z","dependencies_parsed_at":"2023-12-21T01:03:36.729Z","dependency_job_id":"1b083eb1-5170-4dec-8b77-c2bc44703fae","html_url":"https://github.com/vinszent/cq-flake","commit_stats":null,"previous_names":["vinszent/cq-flake","marcus7070/cq-flake"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/vinszent/cq-flake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinszent%2Fcq-flake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinszent%2Fcq-flake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinszent%2Fcq-flake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinszent%2Fcq-flake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vinszent","download_url":"https://codeload.github.com/vinszent/cq-flake/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinszent%2Fcq-flake/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264923080,"owners_count":23683716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cadquery","cq-editor","flake","nix","nix-flake","nixos"],"created_at":"2024-08-01T22:00:30.058Z","updated_at":"2025-07-12T01:31:34.720Z","avatar_url":"https://github.com/vinszent.png","language":"Nix","funding_links":[],"categories":["Miscellaneous"],"sub_categories":[],"readme":"# CadQuery and CQ-editor flake\n\n## What is this\n\nConcepts:\n\n1. [nix package manager](https://nixos.org/guides/nix-pills/why-you-should-give-it-a-try.html) and [the NixOS Linux distribution](https://nixos.org/)\n2. [nix flakes](https://www.tweag.io/blog/2020-05-25-flakes/)\n3. [CadQuery and CQ-editor](https://cadquery.readthedocs.io/en/latest/intro.html)\n4. [Cachix](https://docs.cachix.org/)\n\nThis repo is a nix flake that allows you to reproduce a CadQuery and CQ-editor installation anywhere that has nix. Well, a version of nix with flake support, which is currently only in unstable but should be merged soon. Also, it probably won't work outside of NixOS, because graphic drivers are super difficult to make reproducible. But anyway.\n\nThis means that you can create a model in CadQuery and note down the commit to this repo you used to build it (or fork it and take control yourself). At any point in the future you can use the same command to run CQ-editor and due to the flake describing all the sources of every package used by CQ-editor it will still work, regardless of:\n\n* changes to the CadQuery API breaking backwards compatibility\n* new Python versions\n* nixpkgs dropping support for Sphinx ~~2.4~~ 3.0.2 or whatever other version it gets pinned to next\n* etc., you get the idea, breaking changes anywhere in the chain of packages.\n\nWhile nix is a source based package manager, I publish binaries to to [Cachix](https://docs.cachix.org/). This flake now includes the configuration required to automatically download binaries from my Cachix (thanks [thomaslepoix](https://github.com/thomaslepoix) and [EdenEast](https://github.com/EdenEast)).\n\nNow also includes [cq-kit](https://github.com/michaelgale/cq-kit).\n\n## Commands\n\nTo run CQ-editor:\n\n```sh\nnix run github:marcus7070/cq-flake\n```\n\nNote that I currently set `QT_QPA_PLATFORM=xcb` in the CQ-editor wrapper. I need to do this to get it to work under Wayland, and I think it should work for most X based window managers as well, but YMMV.\n\nTo create an environment with CadQuery and python-language-server (where hopefully your IDE will pick up python-language-server and supply autocomplete, docs, etc.):\n```sh\nnix shell github:marcus7070/cq-flake#cadquery-env\n```\n\nTo create an environment with [yacv-server](https://github.com/yeicor-3d/yet-another-cad-viewer):\n```sh\nnix shell github:marcus7070/cq-flake#yacv-env\n```\nBy default this environment does not supply the frontend. You can either use\nthe github pages frontend hosted\n[here](https://yeicor-3d.github.io/yet-another-cad-viewer/). Or you can start a\nlocal version of the frontend with:\n\n```sh\nnix shell github:marcus7070/cq-flake#yacv-frontend\n```\n\nTo get the most out of this flake you should specify a commit along with those commands and note it down so you are always using the same CadQuery, eg.\n```sh\nnix run github:marcus7070/cq-flake/14d05cee591dccf5d64fa0e502e6e381a531c718\n```\n\nYou can also generate the docs with:\n```\nnix build github:marcus7070/cq-flake#cq-docs\n```\nwhich will leave a symlink called `result` pointing to the HTML docs.\n\n## Local dev\n\nShould you wish to do dev work with CadQuery check out the `dev` branch of this repo. `flake.nix` shows how to reference a local copy (must be a Git repo) of CadQuery instead of a GitHub copy. Then use a command like:\n\n```sh\nnix flake update --update-input cadquery . \u0026\u0026 nix build -L .#cadquery-docs \u0026\u0026 qutebrowser ./result-doc/share/doc/index.html\n```\n\n~~I've also added some debug stuff for debugging with `gdb`. Debugging symbols for Python have come and gone from nixpkgs, if the debugging attributes don't have all the symbols you need look into setting overriding `separateDebugInfo = true;` in the Python expression. The most likely method you need for debugging is to run `nix develop github:marcus7070/cq-flake#cadquery-env-debug`, start python, switch to a second terminal, `gdb python \u003cPID\u003e`, `continue`, switch back to python, make it crash, switch back to gdb, `bt`. gdb can't run scripts so it's difficult to start Python (which under nix is usually a script wrapper around the actual Python binary) from within gdb, easier just to attach it to a running instance.~~\nDebugging currently removed from nixpkgs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinszent%2Fcq-flake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvinszent%2Fcq-flake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinszent%2Fcq-flake/lists"}