{"id":21220616,"url":"https://github.com/tulilirockz/nuspawn","last_synced_at":"2025-06-23T21:35:21.249Z","repository":{"id":239017893,"uuid":"797390161","full_name":"tulilirockz/nuspawn","owner":"tulilirockz","description":"Wrapper for Systemd-Nspawn and Machinectl written in Nushell","archived":false,"fork":false,"pushed_at":"2025-01-08T02:13:57.000Z","size":22065,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-19T04:58:56.735Z","etag":null,"topics":["linux","machinectl","nu","nushell","systemd","systemd-nspawn"],"latest_commit_sha":null,"homepage":"","language":"Nushell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tulilirockz.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-05-07T18:28:09.000Z","updated_at":"2025-01-07T02:13:48.000Z","dependencies_parsed_at":"2024-05-09T14:44:29.762Z","dependency_job_id":"15216965-d0a8-4dda-baf3-5563685251e7","html_url":"https://github.com/tulilirockz/nuspawn","commit_stats":null,"previous_names":["tulilirockz/nuspawn"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tulilirockz/nuspawn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tulilirockz%2Fnuspawn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tulilirockz%2Fnuspawn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tulilirockz%2Fnuspawn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tulilirockz%2Fnuspawn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tulilirockz","download_url":"https://codeload.github.com/tulilirockz/nuspawn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tulilirockz%2Fnuspawn/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261559749,"owners_count":23177265,"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":["linux","machinectl","nu","nushell","systemd","systemd-nspawn"],"created_at":"2024-11-20T22:13:24.912Z","updated_at":"2025-06-23T21:35:21.221Z","avatar_url":"https://github.com/tulilirockz.png","language":"Nushell","funding_links":[],"categories":[],"sub_categories":[],"readme":"```\n888888ba           .d88888b                                           8b\n88    `8b          88.    \"'                                          `8b\n88     88 dP    dP `Y88888b. 88d888b. .d8888b. dP  dP  dP 88d888b.     `8b\n88     88 88    88       `8b 88'  `88 88'  `88 88  88  88 88'  `88     .8P\n88     88 88.  .88 d8'   .8P 88.  .88 88.  .88 88.88b.88' 88    88    .8P\ndP     dP `88888P'  Y88888P  88Y888P' `88888P8 8888P Y8P  dP    dP    8P\n                             88\n                             dP\n```\n\n[![Copr build status](https://copr.fedorainfracloud.org/coprs/tulilirockz/nuspawn/package/nuspawn/status_image/last_build.png)](https://copr.fedorainfracloud.org/coprs/tulilirockz/nuspawn/package/nuspawn/)\n[![License: 3-BSD](https://img.shields.io/github/license/tulilirockz/nuspawn?style=plastic\u0026style=social)](https://github.com/tulilirockz/nuspawn/blob/main/LICENSE)\n\nA [Nushell](https://nushell.sh) wrapper over systemd-nspawn and machinectl initially inspired by the the [nspawn](https://github.com/nspawn/nspawn/tree/master) nspawnhub wrapper script meant to make usage easier and more integrated with [nspawn.org](https://nspawn.org/) (nspawnhub) other registries, and make robust and flexible development environments\n\n## Usage\n\n![Video usage example](./assets/demo.gif)\n\n### Initializing your first machine\n\n```bash\nnuspawn remote list # Table of all the available distros on nspawnhub\n\nnuspawn pull $NAME $IMAGE $TAG # Pull your machine from NspawnHub or other hosts\nnuspawn oci pull $NAME:$TAG # You can also pull OCI images from DockerHub or anywhere else to get a machine\n# Recommented OCI images are the [Toolbx Community Images](https://github.com/toolbx-images/images) and [Universal Blue's distrobox images](https://github.com/ublue-os/toolboxes)\n\nnuspawn enter $NAME # Run the machine in your current CLI\n\n# If something does not work at first, you can use the setup handler to set up everything manually in the container\nnuspawn setup all $NAME\n```\n\n### Status of the machines\n\nYou can check machine data through these troubleshooting commands \n```bash\nnuspawn ps # Lists all machines currently running and their statuses\nnuspawn logs # Fancy table of the systemd journal in the machine\nnuspawn top-tui # top-like TUI with machine processes\nnuspawn top # Lists all processes in the machine + control groups (requires systemd in the machine + --boot flag)\n```\n\n### Configuring machines\n\nYou can configure your machines through the `config` subcommands, by `edit`ing, `apply`ing, or `remove`ing nspawn configurations\n\n```bash\nnuspawn config list # To check every configuration already applied to images\nnuspawn config apply ./example/config/distrobox-like.ini debox # Creates a configuration for the machine after install\nnuspawn config edit debox # Will open nano (by default) for editing the machine's configuration file\nnuspawn config show debox # Shows every property specified in your configuration in a fancy table\nnuspawn config remove debox # Removes any configuration set for `systemd-nspawn@debox.service`\n```\n\n### Inspecting images\n\nYou can fetch images locally without adding them to the systemd-nspawn machine directory by using `nuspawn fetch`\n\n```bash\nnuspawn pull --fetch-to=./debian.tar --type tar debian sid .\n\n# From here you can either extract a tarball, or use mount.ddi to check the image contents\ntar xvf ./debian.tar -C ./debian\n```\n\n### Deleting machines\n\n```bash\n$ nuspawn remove debox\nDo you wish to delete the selected image \"debox\"? [y/N]:\n```\n\nYou can also Prune, which will delete every image from your system, including configurations if specified.\n\n```bash\n$ nuspawn remove --prune-all\nDo you wish to delete all your local images? [y/N]:\n```\n\n### Composing machines\n\nYou can also declare your machines in YAML manifests to have them automatically configured by running `nuspawn compose create $MANIFEST_PATH`\nThey work with all options from the pull command, meaning you can also use oci images as a base\n\n```yaml\n# Version is required due to future breaking changes\nversion: '0.9'\n\n# Notice that you can declare multiple machines here!\nmachines: \n  - name: debox # Required\n    oci: false # If you want to use a docker image instead -\u003e $IMAGE:$TAG, type will not be considered\n    image: debian\n    tag: sid\n    systemd: true # If the distro does not have systemd, we cannot use machinectl to communicate with it, needing to use systemd-nspawn directily\n    no_setup: true # If the automatic setup scripts do not work for some reason you can disable them\n    type: raw # Ignored if OCI=true (\"tar\" type enforced)\n    config: null # Configuration file copied from /$FILE\n    nspawnhub_url: null # You can also specify a custom URL for a specific image\n    env: # Environment variables for init_commands\n      - DEBIAN_FRONTEND=noninteractive\n    init_commands: # Will run when creating the machine, not when logging in through machinectl login \n      - rm -f /etc/apt/apt.conf.d/docker-gzip-indexes /etc/apt/apt.conf.d/docker-no-languages\n      - apt update -y \u0026\u0026 apt upgrade -y\n      - apt install -y sudo systemd-userdbd dbus # These packages are required so that mounting users to the machine works when using the --boot mode\n    inline_config: | # Will be copied to /etc/systemd/nspawn/$MACHINE.nspawn before anything runs, more info in `systemd.nspawn(5)`\n      [Network]\n      VirtualEthernet=no\n    properties: # Systemd service properties, see `systemd.exec(5)`\n      - MemoryMax=2G # You can set a bunch of max properties to the machine, including stuff like RW access to devices\n      - DeviceAllow=/dev/fuse rwm # Allows you to use FUSE within the machine (rclone, docker, etc)\n```\n\nMore examples in the `example/` directory.\n\n## Installing\n\nMost of the packaging is still yet to be done, tracking issue at #3\n\n### Fedora/OpenSUSE/RHEL (RPM)\n\nAvailable in [my COPR @ `tulilirockz/nuspawn`](https://copr.fedorainfracloud.org/tulilirockz/nuspawn)!\n\n### Debian/Ubuntu (DEB)\n\nTODO!\n\n### Arch Linux (PKGBUILD)\n\nTODO!\n\n### Alpine Linux / Chimera / PostmarketOS (APK)\n\nTODO! (maybe), since like... they dont exactly have systemd in them, right?\n\n### NixOS/Nix (Nix)\n\n#### Nix Profile\n\n```bash\nnix profile install github:tulilirockz/nuspawn#\n```\n\n#### Flake\n\n```nix\n{\n  inputs = {\n    # ...\n    nuspawn = {\n      url = \"github:tulilirockz/nuspawn\";\n      inputs.nixpkgs.follows = \"nixpkgs\";\n    };\n    # ...\n  }\n  outputs = {\n    # ...\n    # Install the NuSpawn binary in your NixOS configuration by using inputs.nuspawn.packages.${pkgs.system}.nuspawn in environment.systemPackages\n    # ...\n  }\n}\n```\n\n### Standalone Installation\n\nYou should be able to install this project by using the `install.nu` script on your system. If you want to live dangerously, you can run:\n\n```bash\ncurl -fsSL \"https://raw.githubusercontent.com/tulilirockz/nuspawn/main/install.nu\" | nu\n# or\ncurl -fsSL \"https://raw.githubusercontent.com/tulilirockz/nuspawn/main/install.sh\" | sh\n```\n\nIt is NOT recommended to do that, though!\n\n## Known Issues\n\n### Networking\n\nIf you are trying to run your machine and cant seem to get networking working, make sure that your configuration doesnt have the VirtualEthernet option enabled, like this:\n\n```ini\n[Network]\nVirtualEthernet=no\n```\n\n### Others\n\nAny other weird behaviour you encounter may have been explained in the manpages. (TODO)\nThe machines really have some weird requirements (e.g.: having systemd-userdbd in order to bound users to get to the machine user database) around systemd to make things work.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftulilirockz%2Fnuspawn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftulilirockz%2Fnuspawn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftulilirockz%2Fnuspawn/lists"}