{"id":13578485,"url":"https://github.com/nix-community/disko","last_synced_at":"2025-05-14T02:04:58.504Z","repository":{"id":43999787,"uuid":"168824926","full_name":"nix-community/disko","owner":"nix-community","description":"Declarative disk partitioning and formatting using nix [maintainers=Lassulus Enzime iFreilicht Mic92 phaer]","archived":false,"fork":false,"pushed_at":"2025-05-08T18:36:03.000Z","size":1495,"stargazers_count":2258,"open_issues_count":125,"forks_count":244,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-05-12T02:33:56.381Z","etag":null,"topics":["build-with-buildbot","flakes","nix"],"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/nix-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"docs/supportmatrix.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"nix-community"}},"created_at":"2019-02-02T11:29:07.000Z","updated_at":"2025-05-11T14:44:08.000Z","dependencies_parsed_at":"2024-01-29T02:43:47.689Z","dependency_job_id":"605e8ceb-3ec0-434b-847d-d11039819bb5","html_url":"https://github.com/nix-community/disko","commit_stats":{"total_commits":888,"total_committers":114,"mean_commits":"7.7894736842105265","dds":0.7905405405405406,"last_synced_commit":"785c1e02c7e465375df971949b8dcbde9ec362e5"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Fdisko","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Fdisko/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Fdisko/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Fdisko/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nix-community","download_url":"https://codeload.github.com/nix-community/disko/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253852012,"owners_count":21973839,"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":["build-with-buildbot","flakes","nix"],"created_at":"2024-08-01T15:01:31.031Z","updated_at":"2025-05-14T02:04:58.472Z","avatar_url":"https://github.com/nix-community.png","language":"Nix","funding_links":["https://opencollective.com/nix-community"],"categories":["Nix","nix","others"],"sub_categories":[],"readme":"# disko - Declarative disk partitioning\n\n\u003cimg title=\"\" src=\"./docs/logo.png\" alt=\"Project logo\" width=\"274\"\u003e\n\n[Documentation Index](./docs/INDEX.md)\n\nNixOS is a Linux distribution where everything is described as code, with one\nexception: during installation, the disk partitioning and formatting are manual\nsteps. **disko** aims to correct this sad 🤡 omission.\n\nThis is especially useful for unattended installations, re-installation after a\nsystem crash or for setting up more than one identical server.\n\n## Overview\n\n**disko** can either be used after booting from a NixOS installer, or in\nconjunction with [nixos-anywhere](https://github.com/numtide/nixos-anywhere) if\nyou're installing remotely.\n\nBefore using **disko**, the specifications of the disks, partitions, type of\nformatting and the mount points must be defined in a Nix configuration. You can\nfind [examples](./example) of typical configurations in the Nix community\nrepository, and use one of these as the basis of your own configuration.\n\nYou can keep your configuration and re-use it for other installations, or for a\nsystem rebuild.\n\n**disko** is flexible, in that it supports most of the common formatting and\npartitioning options, including:\n\n- Disk layouts: GPT, MBR, and mixed.\n- Partition tools: LVM, mdadm, LUKS, and more.\n- Filesystems: ext4, btrfs, ZFS, bcachefs, tmpfs, and others.\n\nIt can work with these in various configurations and orders, and supports\nrecursive layouts.\n\n## How to use disko\n\nDisko doesn't require installation: it can be run directly from nix-community\nrepository. The [Quickstart Guide](./docs/quickstart.md) documents how to run\nDisko in its simplest form when installing NixOS. Alternatively, you can also\nuse the new [disko-install](./docs/disko-install.md) tool, which combines\n`disko` and `nixos-install` into one step.\n\nFor information on other use cases, including upgrading from an older version of\n**disko**, using **disko** without NixOS and downloading the module, see the\n[How To Guide](./docs/HowTo.md)\n\nFor more detailed options, such as command line switches, see the\n[Reference Guide](./docs/reference.md)\n\nTo access sample configurations for commonly-used disk layouts, refer to the\n[examples](./example) provided.\n\nDisko can be also used to create [disk images](./docs/disko-images.md).\n\n## Sample Configuration and CLI command\n\nA simple disko configuration may look like this:\n\n```nix\n{\n  disko.devices = {\n    disk = {\n      my-disk = {\n        device = \"/dev/sda\";\n        type = \"disk\";\n        content = {\n          type = \"gpt\";\n          partitions = {\n            ESP = {\n              type = \"EF00\";\n              size = \"500M\";\n              content = {\n                type = \"filesystem\";\n                format = \"vfat\";\n                mountpoint = \"/boot\";\n                mountOptions = [ \"umask=0077\" ];\n              };\n            };\n            root = {\n              size = \"100%\";\n              content = {\n                type = \"filesystem\";\n                format = \"ext4\";\n                mountpoint = \"/\";\n              };\n            };\n          };\n        };\n      };\n    };\n  };\n}\n```\n\nIf you'd saved this configuration in /tmp/disk-config.nix, and wanted to create\na disk named /dev/sda, you would run the following command to partition, format\nand mount the disk.\n\n```console\nsudo nix --experimental-features \"nix-command flakes\" run github:nix-community/disko/latest -- --mode destroy,format,mount /tmp/disk-config.nix\n```\n\n## Related Tools\n\nThis tool is used by\n[nixos-anywhere](https://github.com/numtide/nixos-anywhere), which carries out a\nfully-automated remote install of NixOS.\n\nWe also acknowledge https://github.com/NixOS/nixpart, the conceptual ancestor of\nthis project.\n\n## Licensing and Contribution details\n\nThis software is provided free under the\n[MIT Licence](https://opensource.org/licenses/MIT).\n\nIf you want to contribute, check out [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## Get in touch\n\nWe have a public matrix channel at\n[disko](https://matrix.to/#/#disko:nixos.org).\n\n---\n\nThis project is supported by [Numtide](https://numtide.com/).\n![Untitledpng](https://codahosted.io/docs/6FCIMTRM0p/blobs/bl-sgSunaXYWX/077f3f9d7d76d6a228a937afa0658292584dedb5b852a8ca370b6c61dabb7872b7f617e603f1793928dc5410c74b3e77af21a89e435fa71a681a868d21fd1f599dd10a647dd855e14043979f1df7956f67c3260c0442e24b34662307204b83ea34de929d)\n\nWe are a team of independent freelancers that love open source.  We help our\ncustomers make their project lifecycles more efficient by:\n\n- Providing and supporting useful tools such as this one\n- Building and deploying infrastructure, and offering dedicated DevOps support\n- Building their in-house Nix skills, and integrating Nix with their workflows\n- Developing additional features and tools\n- Carrying out custom research and development.\n\n[Contact us](https://numtide.com/contact) if you have a project in mind, or if\nyou need help with any of our supported tools, including this one. We'd love to\nhear from you.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnix-community%2Fdisko","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnix-community%2Fdisko","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnix-community%2Fdisko/lists"}