{"id":25549695,"url":"https://github.com/hyx0329/freecad-nix-shell","last_synced_at":"2026-02-14T14:30:18.069Z","repository":{"id":242562510,"uuid":"809901976","full_name":"hyx0329/freecad-nix-shell","owner":"hyx0329","description":"Reproducible FreeCAD Workspace with CFD and FEA Capability","archived":false,"fork":false,"pushed_at":"2024-06-12T08:36:19.000Z","size":15464,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2024-06-13T09:20:30.750Z","etag":null,"topics":["cfd","fem","finite-element-analysis","fluid-dynamics","freecad","nix","openfoam"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyx0329.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-06-03T17:06:00.000Z","updated_at":"2024-06-12T16:35:00.000Z","dependencies_parsed_at":"2024-06-12T05:39:20.764Z","dependency_job_id":null,"html_url":"https://github.com/hyx0329/freecad-nix-shell","commit_stats":null,"previous_names":["hyx0329/freecad-nix-shell"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyx0329%2Ffreecad-nix-shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyx0329%2Ffreecad-nix-shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyx0329%2Ffreecad-nix-shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyx0329%2Ffreecad-nix-shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyx0329","download_url":"https://codeload.github.com/hyx0329/freecad-nix-shell/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239816508,"owners_count":19701753,"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":["cfd","fem","finite-element-analysis","fluid-dynamics","freecad","nix","openfoam"],"created_at":"2025-02-20T10:19:36.054Z","updated_at":"2026-02-14T14:30:18.028Z","avatar_url":"https://github.com/hyx0329.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reproducible FreeCAD Workspace with CFD Capability\n\n![Nix and FreeCAD and FEM and CFD](nix-freecad-fem-cfd.svg)\n\nThis project aims to ease the environment setup for FreeCAD CfdOF workbench.\n\nBasically it's a nix-shell configuration of a FreeCAD environment with [CfdOF](https://github.com/jaheyns/CfdOF) installed.\n\n\u003e By the time I finished this project, I found [preCICE adapters and solvers packaged with the Nix package manager](https://github.com/precice/nix-packages) which has a simliar goal(reproducibility). That's a flakes repository for NixOS.\n\n## How to use\n\n1. Install `nix`. Follow the instruction of your distro. Or you can follow [the instructions by nix official](https://nixos.org/download/).\n    - For Arch users, simply `pacman -Sy nix`, and enable `nix-daemon` service.\n1. Change working directory to here, the repository.\n1. Open a new shell with `nix-shell freecad-cfd.nix`. Packages are built in this step. This is the way to launch an interactive shell, and normally the packages are built only once.\n1. In the new shell, install `CfdOF` plugin by executing the script `install-mod-cfdof.sh`\n    - this script pins the module's git revision, making it reproducible\n1. Run `mkdir -p freecad-state/{home,userdata,temp}` to create the folders for FreeCAD data. Read `shellHook` variable in `freecad-cfd.nix` and `cmd.sh` for more details.\n1. (Optional) In console, run `freecad -t TestCfdOF`, and it will test the workbench.\n1. In console, run `freecad`, and enjoy your journey.\n1. (Optional) To further test the environment, you need to load a demo from CfdOF, and run the calculation.\n    - In some cases, testing a single demo cannot ensure everything works.\n1. Later you don't need to run the steps above again if you want to launch FreeCAD directly, just change directory here and execute `start-cfd.sh`. The script will pass the arguments to FreeCAD.\n\n## How it works\n\n- FreeCAD version is pinned with `nixpkgs` release.\n    - Config path is changed with environment variables.\n        - Warning: NEVER hard code ANY path in FreeCAD settings.\n- OpenFOAM and related components which are not maintained in `nixpkgs` are built through local package definitions.\n    - Versions are pinned by pinning source code version.\n    - `cfmesh-cfdof` and `hisa` don't have versioned source code, and their code packages are relatively small, so the code packages are bundled.\n- `CfdOF`'s version is pinned by git commit hash.\n- `nixgl` is used to make UI working.\n\n## Build time\n\nMy building platform: EPYC 7D12(1.1GHz, 32 core 64 threads) with 128G RAM.\n\n- FreeCAD: about 10 minutes\n- OpenFOAM: around 50 minutes, it looks not fully parallel\n- cfmesh-cfdof: the scripts build it sequentially, about 15 minutes\n- hisa: the scripts build it sequentially, about 14 minutes\n- parmetis and scotch are rebuilt for their dynamic linking libraries, and these shouldn't take long time to build\n\nThe rest packages are provided by nixpkgs prebuilts.\n\n## Q\u0026A\n\n### Why does FreeCAD need a rebuild?\n\nAs of FreeCAD 0.21.2, the FEM workbench has a bug that prevents correct detection of solvers in system path.\nIf you don't need this patch or don't want to rebuild, just comment out `freecad-patched` and uncomment `pkgs.freecad` in `freecad-cfd.nix`.\n\n## Credits\n\n- [CfdOF](https://github.com/jaheyns/CfdOF)\n- [AUR openfoam-org](https://aur.archlinux.org/packages/openfoam-org)\n- [AUR openfoam-com](https://aur.archlinux.org/packages/openfoam-com)\n- [AUR scotch](https://aur.archlinux.org/packages/scotch)\n- [AUR parmetis-git](https://aur.archlinux.org/packages/parmetis-git)\n\n## License\n\nThis project is licensed under the MIT license.\nThe license doesn't apply to the bundled source code zips(cfmesh, hisa), which are licensed under GPL3.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyx0329%2Ffreecad-nix-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyx0329%2Ffreecad-nix-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyx0329%2Ffreecad-nix-shell/lists"}