{"id":20177807,"url":"https://github.com/tfc/nspawn-nixos","last_synced_at":"2025-09-02T02:36:36.008Z","repository":{"id":190841349,"uuid":"683381933","full_name":"tfc/nspawn-nixos","owner":"tfc","description":"Accompanying Code for Nixcademy.com Blog Article","archived":false,"fork":false,"pushed_at":"2024-10-22T15:37:02.000Z","size":8,"stargazers_count":60,"open_issues_count":4,"forks_count":12,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-21T00:45:04.035Z","etag":null,"topics":["container","nixos","nspawn","systemd"],"latest_commit_sha":null,"homepage":"https://nixcademy.com/2023/08/29/nixos-nspawn/","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/tfc.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}},"created_at":"2023-08-26T11:46:11.000Z","updated_at":"2025-08-14T08:55:52.000Z","dependencies_parsed_at":"2024-10-23T02:42:13.793Z","dependency_job_id":null,"html_url":"https://github.com/tfc/nspawn-nixos","commit_stats":null,"previous_names":["tfc/nspawn-nixos"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/tfc/nspawn-nixos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfc%2Fnspawn-nixos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfc%2Fnspawn-nixos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfc%2Fnspawn-nixos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfc%2Fnspawn-nixos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tfc","download_url":"https://codeload.github.com/tfc/nspawn-nixos/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfc%2Fnspawn-nixos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273221010,"owners_count":25066514,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"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":["container","nixos","nspawn","systemd"],"created_at":"2024-11-14T02:17:30.135Z","updated_at":"2025-09-02T02:36:35.965Z","avatar_url":"https://github.com/tfc.png","language":"Nix","funding_links":[],"categories":["Nix"],"sub_categories":[],"readme":"# nspawn-nixos\n\nThis repository contains nix recipes of NixOS images that can be run on any\nGNU/Linux that has `systemd` using `machinectl`.\n\n## How to run this\n\nYou don't need `nix` or NixOS to fetch and run the image:\n\n```sh\n# x86_64-linux architecture\nmachinectl pull-tar https://github.com/tfc/nspawn-nixos/releases/download/v1.0/nixos-system-x86_64-linux.tar.xz nixos --verify=no\n\n# aarch64-linux architecture\nmachinectl pull-tar https://github.com/tfc/nspawn-nixos/releases/download/v1.0/nixos-system-aarch64-linux.tar.xz nixos --verify=no\n\nmachinectl start nixos\n# Set root password\nmachinectl shell nixos /usr/bin/env passwd\nmachinectl login nixos\n```\n\nYou can also change the configuration in this repository first, and then import\na local build:\n\n```sh\nmachinectl import-tar $(nix build --print-out-paths)/tarball/* nixos\n```\n\nIf you want the container to use the host's network, create a configuration\nfile like this:\n\n```sh\nprintf \"[Network]\\nVirtualEthernet=no\" \u003e /etc/systemd/nspawn/nixos.nspawn\n```\n\nThe system configuration in `/etc/nixos/configuration.nix` can be adapted to\nyour needs.\n`nixos-rebuild switch` activates a new configuration.\n\nIf you would like to share mounts between host and container, create port\nmappings, etc. please refer to the\n[`systemd.nspawn` config file documentation](https://man7.org/linux/man-pages/man5/systemd.nspawn.5.html)\nand/or the [archlinux wiki about `systemd-nspawn`](https://wiki.archlinux.org/title/systemd-nspawn)\n\n## Why not Docker images?\n\nDocker puts the file system of any Linux distro around a single process, but it\nessentially does not run a whole system.\nRunning NixOS (or any other distro) in `systemd-nspawn` is similar to running a\nfull VM, but with the same thin namespace isolation as in Docker, which leads to\nless overhead.\n\nChanges that you do to your nspawn container remain persistent by default.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftfc%2Fnspawn-nixos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftfc%2Fnspawn-nixos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftfc%2Fnspawn-nixos/lists"}