!oNSIfazDqEcwhcOjSL:matrix.org

disko

354 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko89 Servers

Load older messages


SenderMessageTime
26 Apr 2024
@tim92:matrix.orgtimI don't think that this will work since you need to unmount the live USB to format it as storage device07:16:00
@raj-magesh:matrix.orgRaj
In reply to @tim92:matrix.org
I don't think that this will work since you need to unmount the live USB to format it as storage device
Not sure what you mean, exactly. To clarify, I'm not trying to format the USB while it's live; I'm running this from an existing NixOS install.

If the"live USB" bit uses only ~1 GiB, there should be some way to make use of the remaining space, hopefully.
07:57:47
@perchun:matrix.orgPerchun Pak left the room.07:57:54
@lassulus:lassul.uslassulus changed their profile picture.08:25:00
@vartroc:matrix.org@vartroc:matrix.org

Soooo,
I have decided to just try it.
After debugging some syntax issues, I have encountered this bug:

error:
       … while evaluating the attribute 'diskoScript'

         at /nix/store/3mlzsgflq3z4wsk2arffhd999h1hj17g-disko/share/disko/lib/default.nix:418:15:

          417|
          418|               diskoScript = (diskoLib.writeCheckedBash { inherit pkgs checked; }) "disko" ''
             |               ^
          419|                 export PATH=${lib.makeBinPath ((cfg.config._packages pkgs) ++ [ pkgs.bash ])}:$PATH

       … in the condition of the assert statement

         at /nix/store/y11h0vfmjaf8j1796x0n2454hqldnbbr-0vyi8f8l8cya10dmgfrj0df2iqxlhiyi-source/pkgs/build-support/writers/scripts.nix:32:5:

           31|     assert (types.path.check nameOrPath) || (builtins.match "([0-9A-Za-z._])[0-9A-Za-z._-]*" nameOrPath != null);
           32|     assert (types.path.check content) || (types.str.check content);
             |     ^
           33|     let

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: The option `disko.devices.disk.lvm_vg.root_vg' does not exist. Definition values:
       - In `<unknown-file>':
           {
             lvs = {
               games = {
                 content = {
                   extraArgs = [
           ...

Does anybody have any idea how I can fix this?

Here's my disko.nix:

{
disko.devices = {
	disk = {
		disk0 = {
			type = "disk";
			device = "/dev/nvme1n1";
			content = {
				type = "gpt";
				partitions = {
					esp = {
						name = "ESP";
						size = "500M";
						type = "EF00";
						content = {
							type = "filesystem";
							format = "vfat";
							mountpoint = "/boot";
						};
					};

					root = {
						name = "root0";
						size = "100%";
						content = {
							type = "lvm_pv";
							vg = "root_vg";
						};
					};
				};
			};
		};
		disk1 = {
			type = "disk";
			device = "/dev/nvme0n1";
			content = {
				type = "gpt";
				partitions = {
					root = {
						name = "root1";
						size = "100%";
						content = {
							type = "lvm_pv";
							vg = "root_vg";
						};
					};
				};
			};
		};

		lvm_vg = {
			root_vg = {
				type = "lvm_vg";
				lvs = {
					root = {
						size = "25%FREE";
						content = {
							type = "btrfs";
							extraArgs = ["-f"];
							subvolumes = {
								"/root" = {
							 	 mountpoint = "/";
								};

								"/persist" = {
								mountOptions = ["subvol=persist" "noatime"];
								mountpoint = "/persist";
								};

								"/nix" = {
								mountOptions = ["subvol=nix" "noatime"];
								mountpoint = "/nix";
								};
							};
						};
					};

					games = {
						size = "100%FREE";
						content = {
							type = "btrfs";
							extraArgs = ["-f"];
							subvolumes = {
								"/games" = {
								mountOptions = ["subvol=games" "noatime"];
								mountpoint = "/games";
								};
							};
						};
					};
				};
			};
		};
	};
};
}
15:33:36
@vartroc:matrix.org@vartroc:matrix.orgI couldn't find anything remotely connected with this bug15:34:34
@vartroc:matrix.org@vartroc:matrix.orgIf you need anything else from me, please ask18:58:57
@lassulus:lassul.uslassulusin line 43 you have root_vg but your vg is called root21:38:05
@lassulus:lassul.uslassulusso you would need to change the name also to root instead of root_vg21:38:19
@lassulus:lassul.uslassulusah wait no21:38:30
@lassulus:lassul.uslassulusI misread21:38:32
@lassulus:lassul.uslassuluslvm_vg is under disk instead of of being under lvm_vg in the toplevel21:39:15
@lassulus:lassul.uslassulusso the stuff from line 50 onwards needs to go one lever higher21:39:38
@lassulus:lassul.uslassulussorry for it being so complicated21:40:02
@pxc:matrix.orgpxc changed their display name from pxc to pxc (why).23:32:11
@pxc:matrix.orgpxc changed their display name from pxc (why) to pxc.23:32:18
27 Apr 2024
@pxc:matrix.orgpxc set a profile picture.00:46:07
@pxc:matrix.orgpxc removed their profile picture.00:48:07
@io:meat.computerio joined the room.02:17:24
@lychee:lefishe.club@lychee:lefishe.club left the room.14:36:52
@ygt:matrix.orgnadir joined the room.18:24:47
28 Apr 2024
@vartroc:matrix.org@vartroc:matrix.org
In reply to @lassulus:lassul.us
so the stuff from line 50 onwards needs to go one lever higher
That solved, thanks a lot
13:09:03
@waterturkey:matrix.orgwaterturkey set a profile picture.13:19:38
@vartroc:matrix.org@vartroc:matrix.org* That solved it, thanks a lot13:26:13
@adzuki:matrix.orgadzuki joined the room.15:07:43
@adzuki:matrix.orgadzuki

I'm having problems getting disko and impermanence to work after moving some functionality into separate modules. Here is the output of nixos-rebuild boot --flake /persist/nixos#amstrad:

trace: warning: The legacy table is outdated and should not be used. We recommend using the gpt type instead.
Please note that certain features, such as the test framework, may not function properly with the legacy table type.
If you encounter errors similar to:
"error: The option `disko.devices.disk.disk1.content.partitions."[definition 1-entry 1]".content._config` is read-only, but it's set multiple times,"
this is likely due to the use of the legacy table type.

trace: the create output is deprecated, use format instead
trace: warning: The legacy table is outdated and should not be used. We recommend using the gpt type instead.
Please note that certain features, such as the test framework, may not function properly with the legacy table type.
If you encounter errors similar to:
"error: The option `disko.devices.disk.disk1.content.partitions."[definition 1-entry 1]".content._config` is read-only, but it's set multiple times,"
this is likely due to the use of the legacy table type.

trace: warning: The legacy table is outdated and should not be used. We recommend using the gpt type instead.
Please note that certain features, such as the test framework, may not function properly with the legacy table type.
If you encounter errors similar to:
"error: The option `disko.devices.disk.disk1.content.partitions."[definition 1-entry 1]".content._config` is read-only, but it's set multiple times,"
this is likely due to the use of the legacy table type.

error:
       … while calling the 'seq' builtin

         at /nix/store/370qy3d3wg9zhbn5a3dcv6k1q1iigfh4-source/lib/modules.nix:322:18:

          321|         options = checked options;
          322|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          323|         _module = checked (config._module);

       … while calling the 'throw' builtin

         at /nix/store/370qy3d3wg9zhbn5a3dcv6k1q1iigfh4-source/lib/modules.nix:298:18:

          297|                     ''
          298|             else throw baseMsg
             |                  ^
          299|         else null;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: attribute 'currentSystem' missing

       at /nix/store/370qy3d3wg9zhbn5a3dcv6k1q1iigfh4-source/pkgs/top-level/impure.nix:17:43:

           16|   # (build, in GNU Autotools parlance) platform.
           17|   localSystem ? { system = args.system or builtins.currentSystem; }
             |                                           ^
           18|

This is my disko.nix (located at modules/nixos/system/disko.nix in the nixos config directory:

{
  device ? throw "Set this to your disk device, e.g. /dev/sda",
  ...
}: {
  disko.devices = {
    disk.main = {
      inherit device;
      type = "disk";
      content = {
        type = "gpt";
        partitions = {
          boot = {
            name = "boot";
            size = "1M";
            type = "EF02";
          };
          esp = {
            name = "ESP";
            size = "500M";
            type = "EF00";
            content = {
              type = "filesystem";
              format = "vfat";
              mountpoint = "/boot";
            };
          };
          swap = {
            size = "4G";
            content = {
              type = "swap";
              resumeDevice = true;
            };
          };
          root = {
            name = "root";
            size = "100%";
            content = {
              type = "lvm_pv";
              vg = "root_vg";
            };
          };
        };
      };
    };
    lvm_vg = {
      root_vg = {
        type = "lvm_vg";
        lvs = {
          root = {
            size = "100%FREE";
            content = {
              type = "btrfs";
              extraArgs = ["-f"];

              subvolumes = {
                "/root" = {
                  mountpoint = "/";
                };

                "/persist" = {
                  mountOptions = ["subvol=persist" "noatime"];
                  mountpoint = "/persist";
                };

                "/nix" = {
                  mountOptions = ["subvol=nix" "noatime"];
                  mountpoint = "/nix";
                };
              };
            };
          };
        };
      };
    };
  };
}

And this is the flake.nix used for building:

{
  description = "Nixos config flake";
     
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

    disko = {
      url = "github:nix-community/disko";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    impermanence = {
      url = "github:nix-community/impermanence";
    };

    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = {nixpkgs, ...} @ inputs:
  {
    homeManagerModules.default = ./modules/home-manager;
    nixosConfigurations = {
      amstrad = nixpkgs.lib.nixosSystem {
        specialArgs = { inherit inputs; };
        modules = [
          inputs.disko.nixosModules.default
          (import ./modules/nixos/system/disko.nix { device = "/dev/sda"; })

          ./hosts/amstrad/configuration.nix
	 ./modules/nixos
              
          inputs.impermanence.nixosModules.impermanence
          inputs.home-manager.nixosModules.default
        ];
      };
    };
  };
}

Any help would be greatly appreciated, I'm really stumped by this as it was working before I tried to use impermanence as a module.

15:17:48
29 Apr 2024
@perchun:matrix.orgPerchun Pak joined the room.11:46:45
@perchun:matrix.orgPerchun Pakjust a quick probably stupid question, will disko ignore these 2mb of unallocated space? gparted doesn't want to include them into first partition, the only way would be to move 600gb partition two times (second time on 2mb back)11:49:56
@perchun:matrix.orgPerchun Pakimage.png
Download image.png
11:49:58
@lassulus:lassul.uslassulusNot sure what you mean by ignore. If they are there and you use the format script disko generates it will be gone. If you use disko just to configure your filesystem it has no effect if not specified11:56:43

Show newer messages


Back to Room ListRoom Version: 10