{"id":18435597,"url":"https://github.com/chpxu/development-flake","last_synced_at":"2026-01-30T22:39:14.550Z","repository":{"id":136118200,"uuid":"612233586","full_name":"chpxu/development-flake","owner":"chpxu","description":"A flexible and declarative flake template for C/C++/Python/JS/LaTeX/Fortran development based on direnv, flake-parts and devshell. Maintainer=[@chpxu]","archived":false,"fork":false,"pushed_at":"2026-01-29T10:10:00.000Z","size":95,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-30T01:32:37.323Z","etag":null,"topics":["cpp","devshell","direnv","flake-parts","fortran","latex","nix","python"],"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/chpxu.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-03-10T13:42:26.000Z","updated_at":"2025-12-30T22:05:35.000Z","dependencies_parsed_at":"2024-01-07T00:54:20.648Z","dependency_job_id":"088fc91f-7d5c-489b-8cd2-0780bf12264b","html_url":"https://github.com/chpxu/development-flake","commit_stats":null,"previous_names":["chpxu/development-flake"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/chpxu/development-flake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chpxu%2Fdevelopment-flake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chpxu%2Fdevelopment-flake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chpxu%2Fdevelopment-flake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chpxu%2Fdevelopment-flake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chpxu","download_url":"https://codeload.github.com/chpxu/development-flake/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chpxu%2Fdevelopment-flake/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28921451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T22:32:35.345Z","status":"ssl_error","status_checked_at":"2026-01-30T22:32:31.927Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cpp","devshell","direnv","flake-parts","fortran","latex","nix","python"],"created_at":"2024-11-06T06:08:50.076Z","updated_at":"2026-01-30T22:39:14.535Z","avatar_url":"https://github.com/chpxu.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Development Template with direnv\n\nOpinionated flake for development of various things I work on using multiple languages/frameworks/tools. Uses `flake-utils`, `direnv` and `nix-direnv`. The motivation for this is to create an environment which is easy to use\n\n## Workflow\n\nThis flake is intended to fit with my workflow, which is with [Visual Studio Code](https://code.visualstudio.com), NixOS and direnv. This project is not intended to be a replacement or alternative to excellent projects such as direnv, devenv, lorri etc. The flake setups up a reproducible development environment for different programming contexts, and aims to be as declarative as possible whilst allowing some flexibility. \n\nTo use it:\n\n1. Install nix on your system.\n2. Have [`direnv`](https://direnv.net/) installed on your system (follow their instructions). Ideally use [`nix-direnv`](https://github.com/nix-community/nix-direnv) for faster and more persistent caching. You do not need NixOS as the Nix package manager can be installed anywhere, as can `home-manager`. Example configurations:\n\n```nix\n## home-manager example configuration\n# e.g. home.nix\nprograms = {\n    direnv = {\n      enable = true;\n      enableZshIntegration = true;\n      nix-direnv.enable = true;\n    };\n\n    zsh.enable = true;\n  };\n\n# ====\n# System (NixOS) example configuration:\n{\n  programs.direnv = {\n    enable = true;\n    nix-direnv.enable = true;\n  };\n}\n```\n\n3. Click `\"Use this template\"` on GitHub, then `\"Create a new repository\"`. Follow the steps there, then clone your repository to somewhere locally on your own system\n4. Enter the repository folder.\n5. Modify the flake to include what you want.\n6. Run `direnv allow .` and it will drop you into the containerised environment.\n\n## Features\n\n- `C/C++` based off [fufexan's config](https://gist.github.com/fufexan/2e7020d05ff940c255d74d5c5e712815)\n  - Summary: GCC or Clang/LLVM C/C++ development environment.\n- `Python` with pre-installed packages intended for scientific work and visualisation.\n  - Default packages: `numpy, scipy, matplotlib`.\n  - Option for `Jupyter`.\n  - Uses [black for code formatting](https://github.com/psf/black), [mypy for static type analysis](https://github.com/python/mypy) and [flake8](https://flake8.pycqa.org/en/latest/) for linting.\n- `Node/JS/TS` with pre-installed packages for `nodejs, yarn`.\n  - The packages installed here are minimal since I prefer to use `package.json`s for each individual project.\n  - Uses Prettier for code formatting of HTML/Markdown/JS/TS/JSON etc. by default.\n- `TeXLive 2022 Full`, with `LTeX-LS` and VSCode settings for `LaTeX Workshop` and `LTeX` extensions/ \n- Easy modification of development environments for each language.\n\u003c!-- - Setting up local `settings.json` for VSCode (WIP). --\u003e\n## Configuring for your own use\n\nTo minimise clutter with projects, the majority of configuration is done inside the `nix` folder, with the `flake.nix` (and corresponding lockfile) left in the root of the directory. This section of the README can be considered to be the \"Documentation\".\n\n### Modifying `flake.nix`\n\nThe `flake.nix` file brings all the configuration together and initialises the development shell: that is its only function. You might want to modify it if you want it to build a derivation for your use case specifically, or change what is installed, for example.\n\nThe `nix` folder structure looks something like this:\n```\n.\n└── nix/\n    ├── default.nix\n    ├── packages/\n    │   ├── c/\n    │   │   ├── c.nix\n    │   │   └── # other c/c++ configuration files\n    │   ├── python/\n    │   │   ├── python.nix\n    │   │   └── # other python configuration files\n    │   ├── js/\n    │   │   ├── js.nix\n    │   │   └── # other js configuration files\n    │   └── #  other languages\n    ├── overlays/\n    │   └── default.nix\n    └── misc/\n        ├── write_vscode_settings.nix\n        ├── helper.nix\n        └── # other files\n```\n\n- `default.nix` is the file which imports and includes everything from all the other files and sets up package configuration, shellHook, vscode configuration etc. This file is then included inside `flake.nix` to be consumed by `devShells`.\n- `packages/\u003clanguage\u003e` folders contain nix files that detail the relevant packages to be installed.\n- `overlays` folder contains, well, any overlays you might want to use. \n  - For example, configuring python311 to `enableOptimisations` and disable `reproducibleBuild` for potential speedups\n- `misc` folder contains any general functions written to be used across the project (`helper.nix`), and any configuration that does not directly impact the shell itself (e.g. editor settings).\n\n### Editor/IDE Integration\n\nCurrently this is WIP, and my main goal is making sure this flake works well with VSCode.\n\n### Visual Studio Code\n\n1. Have the [direnv extension](https://marketplace.visualstudio.com/items?itemName=mkhl.direnv) installed (either globally or in your workspace). Ensure you trust your workspace so it can execute shell scripts.\n\nThe repository contains a file `misc/write_vscode_settings.nix` which converts sets of Nix expressions to a JSON string, and then writes to `.vscode/settings.json` in the directory where the flake is located. The file created *is* editable which means you can mess around with settings after the original file is created, however the file is not prettified and you may want external tools like `jq` or an extension like `Prettier` to auto-format it back to a readable state.\n\n### (Neo)Vim\n\nUntested, I don't use vim for serious development, so I'm unaware of many solutions.\n\n1. Install [vim-direnv](https://github.com/direnv/direnv.vim) with your plugin manager.\n\n### Emacs\n\n1. Install [emacs-direnv](https://github.com/wbolster/emacs-direnv).\n\n## Contributing\n\nThanks for viewing this repo!\n\nI don't really use anything other than NixOS and VSCode. I don't do development on Windows anymore. Extending the flake to cope with some other editors or platforms would be greatly appreciated and would help a bunch of others if they ever happen to come across this.\n\n## Other niceties\n\n- [zsh](https://www.zsh.org/) and [starship](https://starship.rs/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchpxu%2Fdevelopment-flake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchpxu%2Fdevelopment-flake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchpxu%2Fdevelopment-flake/lists"}