{"id":14155640,"url":"https://github.com/lucernae/devcontainer-nix","last_synced_at":"2025-04-10T05:23:35.861Z","repository":{"id":43743627,"uuid":"511455788","full_name":"lucernae/devcontainer-nix","owner":"lucernae","description":"VSCode devcontainer for Nix","archived":false,"fork":false,"pushed_at":"2025-03-31T20:24:06.000Z","size":189,"stargazers_count":8,"open_issues_count":11,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-31T21:27:32.217Z","etag":null,"topics":["devcontainer","devcontainers","nix","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/lucernae.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["lucernae"],"patreon":null,"open_collective":null,"ko_fi":"lucernae","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2022-07-07T09:01:52.000Z","updated_at":"2025-03-15T00:52:16.000Z","dependencies_parsed_at":"2024-05-08T23:31:44.747Z","dependency_job_id":"539541c2-53fe-4e8e-9912-caa5ba1703b6","html_url":"https://github.com/lucernae/devcontainer-nix","commit_stats":{"total_commits":122,"total_committers":3,"mean_commits":"40.666666666666664","dds":0.06557377049180324,"last_synced_commit":"b57bdea4c9337406205b33f7876095a14326f65b"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucernae%2Fdevcontainer-nix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucernae%2Fdevcontainer-nix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucernae%2Fdevcontainer-nix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucernae%2Fdevcontainer-nix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucernae","download_url":"https://codeload.github.com/lucernae/devcontainer-nix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161731,"owners_count":21057643,"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":["devcontainer","devcontainers","nix","nixos"],"created_at":"2024-08-17T08:04:38.629Z","updated_at":"2025-04-10T05:23:35.834Z","avatar_url":"https://github.com/lucernae.png","language":"Nix","funding_links":["https://github.com/sponsors/lucernae","https://ko-fi.com/lucernae"],"categories":["nix"],"sub_categories":[],"readme":"# Devcontainer for Nix\n\n[![Open the repo in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true\u0026ref=main\u0026repo=511455788)\n\n[![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers\u0026message=Open\u0026color=blue\u0026logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/lucernae/devcontainer-nix)\n\nVSCode devcontainer for Nix\n\nThis devcontainer contains Nix and hooks to install nix recipe as devcontainers.\nThis is the base image that can be used to extend your own devcontainer based on nix.\n\n# How to use\n\nThis repo contains devcontainer templates to make it easy to generate devcontainer configurations. If you prefer \na more hands on approach, you can also check out sample configuration described in the [next section](#currently-available-devcontainer-samples)\n\nIn your own repo, simply copy our [.devcontainer](.devcontainer) directory and extend as necessary using the provided files that directory:\n\n- `default.nix` replace with your nix recipe. You can also include recipes in other repo by including it in this recipe\n- `Dockerfile` if you need to extend the image and include several files here\n- `docker-compose.yml` if you need to extend docker-compose recipe to do/mount extra things for your devcontainer\n- `devcontainer.json` if you need to include custom settings like extensions, etc.\n\nTo generate these files using devcontainer CLI, you first need to install the CLI. It is usually packaged along VS Code's Remote Containers extensions tools. So you probably have it already.\n\nThe template definition and available options is located in the [template source directory](./templates/src/nix/README.md)\n\nFrom your own repository directory, create a .devcontainer directory with the options JSON file\n\n```bash\nmkdir -p .devcontainer\ntouch .devcontainer/args.json\n```\n\nThe file `args.json` contains the options you want to activate and pass to devcontainer CLI. This is an example to use Direnv and Flake:\n\n```json\n{\n    \"useDirenv\": \"true\",\n    \"useFlake\": \"false\"\n}\n```\n\nGenerate the devcontainers file using CLI, and the template package `ghcr.io/lucernae/devcontainer-nix/nix:1`:\n\n```bash\ndevcontainer templates apply -t ghcr.io/lucernae/devcontainer-nix/nix:1 --workspace-folder . -a \"$(cat .devcontainer/args.json)\"\n```\n\nOnce the files are generated, you can use VS Code's command \"Reopen in Container\" (available from the command palette: CTRL+SHIFT+P), or `devcontainer up` command to test the devcontainer creations:\n\n```bash\ndevcontainer up --workspace-folder .\n```\n\n# Currently available devcontainer samples\n\n- [default](.devcontainer/default/): minimal example on how to use the devcontainer with direnv\n- [development](.devcontainer/development/): my preferred way of using GitHub Codespace to bootstrap this own repo's development\n- [home-manager](.devcontainer/home-manager/): (TBD) use flake URI to fetch your home-manager config to setup the devcontainer\n- [nixos](.devcontainer/nixos-arion/): use a [codespace template](https://github.com/lucernae/codespaces-nixos-template) to bootstrap a NixOS as a container.\n  You can then use NixOS capabilities, such as systemd services definitions, NixOS modules, etc.\n\n# Development\n\nThis repository mainly contains Docker recipe to build the devcontainer image.\n\nRequired tech stack:\n- Nix\n- Docker/Docker Compose\n- Bash\n\nBuilding the image:\n\n```\nmake build\n```\n\nRunning the stack locally:\n\n```\nmake up\n```\n\n# Supporting and Contributing\n\nIf you like this project, show your love. Even feedbacks are most appreciated.\n\n## Sponsoring\n\nYou can sponsor this project to help me experiment with the codespace, since I mostly run out of codespace \nstorage quota pretty quickly. The storage was mostly used when you are experimenting with lots of \npackages that fills out Nix store. The final image itself is less than 1GB. By sponsoring, I can avoid\nrunning low of storage quotas.\n\n## Contributing\n\nThere are no clear guideline yet. Since this is a template, you can contribute your own recipes, and I can \npublish it as a branch so people can use it quickly. Do you have some cool examples on how to use Nix, Nix flakes, or Home Manager? Feel free to publish it here. You might be helping someone.\n\nDo you have some problem with Nix? You can even use this template so people can see and try out your \nconfiguration to debug the problem.\n\n## Not able to sponsor or contribute?\n\nNo worries, spreading the words or starring the repo might help as well. Thank you!\n\n# References/Remarks\n\n- Thanks to [Arion](https://github.com/hercules-ci/arion). I built the image in Nix using this tools.\n- Thanks to Nix Community who helps and provides docs/articles for introverts like me.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucernae%2Fdevcontainer-nix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucernae%2Fdevcontainer-nix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucernae%2Fdevcontainer-nix/lists"}