{"id":22168703,"url":"https://github.com/ciderale/nixos-lima","last_synced_at":"2026-04-19T13:32:06.755Z","repository":{"id":262138092,"uuid":"886296432","full_name":"ciderale/nixos-lima","owner":"ciderale","description":"NixOS for MacOS using Lima-VM","archived":false,"fork":false,"pushed_at":"2025-11-26T23:34:38.000Z","size":82,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-29T00:48:49.100Z","etag":null,"topics":["aarch64","docker","lima-vm","linux","macos","nixos","vm"],"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/ciderale.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-10T17:39:37.000Z","updated_at":"2025-11-26T23:33:39.000Z","dependencies_parsed_at":"2024-11-10T19:36:41.129Z","dependency_job_id":"9e00946f-f328-4746-8e69-fefbb9114eb3","html_url":"https://github.com/ciderale/nixos-lima","commit_stats":null,"previous_names":["ciderale/nixos-lima"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ciderale/nixos-lima","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciderale%2Fnixos-lima","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciderale%2Fnixos-lima/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciderale%2Fnixos-lima/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciderale%2Fnixos-lima/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ciderale","download_url":"https://codeload.github.com/ciderale/nixos-lima/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciderale%2Fnixos-lima/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32009108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["aarch64","docker","lima-vm","linux","macos","nixos","vm"],"created_at":"2024-12-02T06:24:56.588Z","updated_at":"2026-04-19T13:32:06.735Z","avatar_url":"https://github.com/ciderale.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NixOS for MacOS using Lima-VM\n\nThis project combines [NixOS](nixos.org) with [Lima](lima-vm.io) to provide\nreproducible NixOS deployments on MacOS with aarch64 architecture.\n\n## Usage (off-the-shelf)\n\n```\nnix run github:ciderale/nixos-lima start\n```\n\nThe above command boots a VM (named `mynixos`) using lima and deploys an NixOS configuration.\nThe default configuration includes docker engine and adds some default volume mounts.\n\n## Container support\n\nThe default `nixos-lima` configuration includes a docker installation. On VM\ncreation, `nixos-lima` also generates a shell script `~/.lima/mynixos.shrc` to setup\nthe DOCKER_HOST and CONTAINER_HOST variable and add `docker` to your PATH.\nYou could add this to your .zprofile startup script for example.\n\nIn addition to lima-vm.io's port forwarding, `nixos-lima` can listens to the\ndocker event stream and provide port mapping more promptly than via polling.\n\n```\nnix run github:ciderale/nixos-lima portmapperd\n```\n\nThe subcommand `nix run github:ciderale/nixos-lima full` combines `start`\nand `portmapperd` in one. Stopping `full` with ctrl-c currently also stops\nthe virtual machine (unless it was already running).\n\n## Adhoc customization using NIXOS_LIMA_IMPURE_CONFIG\n\nYou can extend the system configurations by pointing the NIXOS_LIMA_IMPURE_CONFIG\nenvironment variable to additional configuration files. The configuration includes all\n[nixos options](https://search.nixos.org/options) as well as the [lima-vm configurations](https://lima-vm.io).\n\nFor example, the following configuration defines cpu/memory/disk size,\nadditional mount locations from host to guest, and a docker registry mirror.\n```\n{\n  lima.settings = {\n    cpus = 8;\n    memory = \"8GB\";\n    disk = \"60GB\";\n    mounts = [ { location = \"/host/folder/data\"; mountPoint = \"/data\"; } ];\n  };\n  virtualisation.docker.daemon.settings.registry-mirrors = [ \"https://xxx.xxx.xxx\" ];\n}\n```\nFor more examples see \"example/lima-settings.nix\". It's worth noting that the options\nunder `lima.settings` correspond to lima templates and are used to the generate the\n`lima.yaml` configuration. Moreover, the mount location must exist or the vm does\nnot start.\n\nChanges are applied by re-running `nixos-lima start`.\n\n```\nNIXOS_LIMA_IMPURE_CONFIG=configuration.nix nix run github:ciderale/nixos-lima start\n```\n\nNote that changes to `lima.settings` result in a restart of the VM for those\nchanges to take effect. Normal nixos options changes are applied by means of\n`nixos-rebuild switch` and don't require a VM restart. `nixos-lima` takes care\nof the entire process.\n\nTechnically, the referenced configuration files are merged into the existing\nconfiguration using the nix modules `{ imports = [ ... ]; }` expression.\nMultiple files may be referenced (separated by comma, e.g., `NIXOS_LIMA_IMPURE_CONFIG=sizing.nix,mounts.nix`\nand each file may be an absolute path or relative to the current working directory.\n\n\n## Usage with advanced customisation\n\nMore advanced configuration are better versioned explicitly using git. The\n`nixos-lima` repository provides a nix flake template to start building the own\nconfiguration. This approach is more flexible and allows to remove configuration\npresent in the example configuration.\n\n```\n# create a new repository to track your changes\ncd some/path \u0026\u0026 mkdir mynixos \u0026\u0026 cd mynixos\nnix flake init -t github:ciderale/nixos-lima\n\n# deploy (and update) the configuration\nnix run .#nixos-lima -- mynixos start\n\n# get shell access to your machine\nnix run .#nixos-lima -- mynixos ssh\n```\n\n# Related work\n\n## https://lima-vm.io\n\nAs the name suggests, `nixos-lima` uses lima-vm.io as its underlying\nvirtualisation system. `nixos-lima` also benefits from the port- and\nvolume-mapping functionality provided by lima. Configuration in lima is done\nvia yaml templates and the linux vm is setup using cloud-init scripts.\n\nIn contrast, `nixos-lima` has a minimal cloud-init setup and instead relies on\nNixOS configurations. NixOS provides a modular configuration system with many\npre-configured services. Moreover, NixOS generates highly reproducible\ndeployments.\n\n## https://github.com/kasuboski/nixos-lima\n\n`kasuboski/nixos-lima` also aims for running nixos on lima, hence the same\nname. A key difference is how the two projects bootstrap a system.\n\n`kasuboski/nixos-lima` uses the [nixos-generator](https://github.com/nix-community/nixos-generators) project to build an initial\nimage. This approach requires a linux system running nix. For example, a\nlima-vm can be used with cloud-init script to setup nix. A benefit of this\nis that the generated image can be reused multiple times.\n\nIn contrast, `nixos-lima` uses\n[nixos-anywhere](https://github.com/nix-community/nixos-anywhere) to deploy\nNixOS onto a freshly started lima-vm. In other words, instead of starting a vm\nto build an image, which is then used for a second vm, `nixos-lima` starts one\nvm and overwrites that system with the nixos configuration.\n\nMoreover, `nixos-lima` integrates the lima-vm configuration into the NixOS module\nsystem and provides a unified configuration experience.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciderale%2Fnixos-lima","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fciderale%2Fnixos-lima","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciderale%2Fnixos-lima/lists"}