Disko: Difference between revisions

imported>B-
Add Disko documentation index towards the top of the page
update disko config to one from this decade
Line 8: Line 8:


{{file|disko-config.nix|nix|<nowiki>
{{file|disko-config.nix|nix|<nowiki>
{ disks ? [ "/dev/vda" ], ... }: {
{
   disko.devices = {
   disko.devices = {
     disk = {
     disk = {
       vdb = {
       main = {
         device = builtins.elemAt disks 0;
         device = "/dev/vda";
         type = "disk";
         type = "disk";
         content = {
         content = {
           type = "table";
           type = "gpt";
          format = "gpt";
           partitions = {
           partitions = [
             ESP = {
             {
               end = "500M";
               name = "ESP";
               type = "EF00";
              start = "1MiB";
               end = "500MiB";
              bootable = true;
               content = {
               content = {
                 type = "filesystem";
                 type = "filesystem";
Line 28: Line 25:
                 mountpoint = "/boot";
                 mountpoint = "/boot";
               };
               };
             }
             };
             {
             root = {
               name = "root";
               name = "root";
              start = "500MiB";
               end = "-0";
               end = "100%";
              part-type = "primary";
               content = {
               content = {
                 type = "filesystem";
                 type = "filesystem";
Line 39: Line 34:
                 mountpoint = "/";
                 mountpoint = "/";
               };
               };
             }
             };
           ];
           };
         };
         };
       };
       };
Line 53: Line 48:


<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
# sudo nix run github:nix-community/disko -- --mode zap_create_mount ./disko-config.nix
# sudo nix run github:nix-community/disko -- --mode disko ./disko-config.nix
</syntaxhighlight>
</syntaxhighlight>


Alternativley use a disk layout configuration of a [https://github.com/Lassulus/flakes-testing remote repository] containing a <code>flake.nix</code> file as an entry point. The <code>--arg</code> parameter specifies the target disk <code>/dev/sda</code>.
Alternativley use a disk layout configuration of a [https://github.com/Lassulus/flakes-testing remote repository] containing a <code>flake.nix</code> file as an entry point.


<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
# sudo nix run github:nix-community/disko -- --mode zap_create_mount --flake github:Lassulus/flakes-testing#fnord --arg disks '[ "/dev/sda" ]'
# sudo nix run github:nix-community/disko -- --mode disko --flake github:Lassulus/flakes-testing#fnord
</syntaxhighlight>
</syntaxhighlight>


Line 97: Line 92:
         ./disko-config.nix
         ./disko-config.nix
         {
         {
           _module.args.disks = [ "/dev/vda" ];
           disko.devices.main.device = nixpkgs.lib.mkForce "/dev/vda";
         }
         }
         ./configuration.nix
         ./configuration.nix