diff --git a/nixos/modules/tasks/storage/default.nix b/nixos/modules/tasks/storage/default.nix index d9854b0e1529b6..b9a3c856569c84 100644 --- a/nixos/modules/tasks/storage/default.nix +++ b/nixos/modules/tasks/storage/default.nix @@ -281,7 +281,7 @@ in # If no label is set, reference the device via the generated UUID in # genericOptions.uuid. (lib.mkIf (config.storage != null && config.label == null) { - device = "/dev/disk/by-uuid/${config.storage.config.uuid}"; + device = "/dev/disk/by-uuid/${config.storage.uuid}"; }) ]; })); @@ -304,7 +304,7 @@ in # If no label is set, reference the device via the generated UUID in # genericOptions.uuid. config = lib.mkIf (config.storage != null && !options.label.isDefined) { - device = "/dev/disk/by-uuid/${config.storage.config.uuid}"; + device = "/dev/disk/by-uuid/${config.storage.uuid}"; }; })); }; diff --git a/nixos/modules/tasks/storage/lib.nix b/nixos/modules/tasks/storage/lib.nix index c39b3ffb1a1801..ab194759e0914f 100644 --- a/nixos/modules/tasks/storage/lib.nix +++ b/nixos/modules/tasks/storage/lib.nix @@ -92,10 +92,10 @@ let in if typeAndName == null then null else rec { type = lib.head typeAndName; name = lib.last typeAndName; - # The configuration entry for the storage spec. Note that we don't need to - # check whether ${type} and ${name} exist, because they're already checked - # in assertSpec. - config = cfg.${type}.${name}; + # The generated UUID for the storage spec. Note that we don't need to check + # whether ${type} and ${name} exist, because they're already checked in + # assertSpec. + inherit (cfg.${type}.${name}) uuid; }; /* Validate the device specification and return true if it's valid or false if