{"id":20613203,"url":"https://github.com/konradmalik/darwin-docker","last_synced_at":"2025-08-11T00:35:20.827Z","repository":{"id":219075105,"uuid":"748097722","full_name":"konradmalik/darwin-docker","owner":"konradmalik","description":"nix-darwin module to run docker","archived":false,"fork":false,"pushed_at":"2024-08-09T11:46:13.000Z","size":15,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T17:34:31.890Z","etag":null,"topics":["docker","docker-on-mac","macos","nix","nix-darwin"],"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/konradmalik.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":"2024-01-25T09:16:00.000Z","updated_at":"2024-12-25T09:19:23.000Z","dependencies_parsed_at":"2024-06-08T10:53:39.675Z","dependency_job_id":"9c109ed8-19b4-45c6-88d0-c7c6657dbe9b","html_url":"https://github.com/konradmalik/darwin-docker","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"9cc4d9e879a53b404b812fd3b0012657cbd68e6a"},"previous_names":["konradmalik/darwin-docker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konradmalik%2Fdarwin-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konradmalik%2Fdarwin-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konradmalik%2Fdarwin-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konradmalik%2Fdarwin-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/konradmalik","download_url":"https://codeload.github.com/konradmalik/darwin-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249023725,"owners_count":21199960,"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":["docker","docker-on-mac","macos","nix","nix-darwin"],"created_at":"2024-11-16T11:09:08.851Z","updated_at":"2025-04-15T07:11:01.778Z","avatar_url":"https://github.com/konradmalik.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker module for nix-darwin\n\n## Important!\n\nFor some reason this does not work anymore for me. The VM does not start at all when I enable docker.\nMaybe I'll fix it someday, but it's hard to debug. For now I just use [lima](https://github.com/lima-vm/lima) for docker on Mac and start it on-demand.\n\n## Before enable\n\nYou may need to enable to `linux-builder` without this addon first (`nix.linux-builder.enable = true`).\nThis is because you need some machine to build linux configuration on darwin.\n\n## Usage\n\nImport the module to your configuration, then enable with:\n\n```nix\n# just an example\n{ inputs, ... }:\n{\n  imports = [\n    inputs.darwin-docker.darwinModules.docker\n  ];\n\n  virtualisation.docker = {\n    enable = true;\n  };\n}\n```\n\nThen rebuild your config, make sure `DOCKER_HOST` is set. If not set it manually:\n\n```bash\nexport DOCKER_HOST=\"tcp://127.0.0.1:2375\"\n```\n\nthen run:\n\n```bash\n$ docker info\n```\n\nIt should connect and print relevant info.\n\nSee the module code for more options.\n\nTip: if you have a NixOS config for docker, you should be able to do something like this:\n\n- in linux.nix\n\n```nix\n{\n  virtualisation.docker = {\n    enable = true;\n    autoPrune = {\n      enable = true;\n      flags = [ \"--all\" ];\n      dates = \"weekly\";\n    };\n  };\n}\n```\n\n- in darwin.nix:\n\n```nix\n{ pkgs, inputs, ... }:\n{\n  imports = [\n    inputs.darwin-docker.darwinModules.docker\n  ];\n\n  virtualisation.docker = {\n    enable = true;\n    config = import ./linux.nix;\n  };\n}\n```\n\n## Notes\n\n- why? because if you're already using nix-darwin, then this VM will be very lightweight in terms of disk space and very fast to start\n- this builds on top of `nix-builder` module and `darwin-builder` VM\n- it runs as a daemon in the background\n- docker is exposed on `tcp://127.0.0.1:2375` on the host system\n- `DOCKER_HOST` env variable is set to the above address\n- configuration/customization can be easilty done via `virtualisation.docker.config` - this gets directly passed to the underlying NixOS VM config as a module\n- ssh access directly to the machine should be possible with: `sudo ssh linux-builder`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonradmalik%2Fdarwin-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonradmalik%2Fdarwin-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonradmalik%2Fdarwin-docker/lists"}