{"id":15679270,"url":"https://github.com/zimbatm/vscode-devcontainer-nix","last_synced_at":"2025-05-07T09:28:24.039Z","repository":{"id":66382256,"uuid":"226548272","full_name":"zimbatm/vscode-devcontainer-nix","owner":"zimbatm","description":"WIP: VSCode remote container for Nix-based environments","archived":false,"fork":false,"pushed_at":"2023-12-15T17:33:31.000Z","size":21,"stargazers_count":12,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T08:39:28.688Z","etag":null,"topics":["devcontainer","nix","vscode"],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zimbatm.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":"2019-12-07T17:09:15.000Z","updated_at":"2024-08-12T05:05:24.000Z","dependencies_parsed_at":"2024-01-14T15:29:49.577Z","dependency_job_id":"9f02de97-8606-43bf-964f-bac0efe93498","html_url":"https://github.com/zimbatm/vscode-devcontainer-nix","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbatm%2Fvscode-devcontainer-nix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbatm%2Fvscode-devcontainer-nix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbatm%2Fvscode-devcontainer-nix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimbatm%2Fvscode-devcontainer-nix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zimbatm","download_url":"https://codeload.github.com/zimbatm/vscode-devcontainer-nix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252850398,"owners_count":21813958,"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","nix","vscode"],"created_at":"2024-10-03T16:28:03.346Z","updated_at":"2025-05-07T09:28:24.012Z","avatar_url":"https://github.com/zimbatm.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vscode-devcontainer-nix\n\n**STATUS: alpha**\n\nFor colleagues who insist on working on macOS and Windows. Even though all the\nbinaries are built for, deployed and executed on Linux servers.\n\n[Visual Studio Core Remote - Containers](https://code.visualstudio.com/docs/remote/containers)\nis a feature that allows to create a docker-based development environment.\nVSCode will start the container and run all the commands inside of it.\n\nThis project's goal is to provide such container to work on Nix-based\nprojects.\n\n## Usage\n\n1. Install the [VSCode \"Remote - Containers\" plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)\n2. Copy this repo under `.devcontainer` in the target project\n\nThen VSCode would start the container and drop you into the nix-based\ndevelopment environment.\n\n## How it works\n\nThe VSCode plugin:\n\n* looks for the .devcontainer folder\n* builds the .devcontainer/Dockerfile\n* starts the container\n\nThen it uses uses `docker exec` to copy and install\nsupporting binaries into the container. This includes some bash scripts, a\nnode program, .... The binaries are compiled to work on Ubuntu which means\nthat /lib64/ld-linux-x86-64.so.2 must present, and a few other supporting\nlibraries.\n\nIt needs:\n* a /tmp folder\n* /bin/bash\n* /bin/sh\n* /usr/bin/env\n* sed\n* iproute\n\nAll of this is pre-built by the\n[docker-nixpkgs](https://github.com/nix-community/docker-nixpkgs) project into\nthe nixpkgs/devcontainer image.\n\nOn Linux, the user must adjust the Dockerfile so that the UID and GID inside\nof the container match the user UID and GID. It looks like this could be\nautomated. Right now there is this convention in the Dockerfile:\n```\nARG USERNAME=vscode\nARG USER_UID=1000\nARG USER_GID=$USER_UID\n```\n\nI think vscode auto-detects the user UID and GID and injects them at build\ntime. To be confirmed.\n\n## TODO\n\n* startup nix-daemon --daemon in the background\n* run `direnv allow .` once the container started\n\n## Roadmap\n\n1. [x] Make it work\n2. [x] Pure nix-based docker container?\n3. [ ] It would be nice if the vs extensions could be composed together.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimbatm%2Fvscode-devcontainer-nix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzimbatm%2Fvscode-devcontainer-nix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimbatm%2Fvscode-devcontainer-nix/lists"}