mirror of
https://github.com/nix-community/disko.git
synced 2026-12-03 06:23:28 +01:00
lib: Evaluate partition's _index parameter
This is required to be able to generate sgdisk invocations that are equivalent to what's currently generated in nix.
This commit is contained in:
1 parent
4f16850ca4
commit
70efb0a658
3 files changed
+7
-1
No files matched your search
@@ -44,6 +44,7 @@ let
|
|||||||
|
|
||||||
diskoConfig = evaluatedConfig.config.disko.devices;
|
diskoConfig = evaluatedConfig.config.disko.devices;
|
||||||
|
|
||||||
finalConfig = lib.filterAttrsRecursive (name: value: !lib.hasPrefix "_" name) diskoConfig;
|
shouldBeEvaluated = name: (!lib.hasPrefix "_" name) || (name == "_index");
|
||||||
|
finalConfig = lib.filterAttrsRecursive (name: value: shouldBeEvaluated name) diskoConfig;
|
||||||
in
|
in
|
||||||
finalConfig
|
finalConfig
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
"efiGptPartitionFirst": true,
|
"efiGptPartitionFirst": true,
|
||||||
"partitions": {
|
"partitions": {
|
||||||
"ESP": {
|
"ESP": {
|
||||||
|
"_index": 1,
|
||||||
"alignment": 0,
|
"alignment": 0,
|
||||||
"content": {
|
"content": {
|
||||||
"device": "/dev/disk/by-partlabel/disk-main-ESP",
|
"device": "/dev/disk/by-partlabel/disk-main-ESP",
|
||||||
@@ -32,6 +33,7 @@
|
|||||||
"type": "EF00"
|
"type": "EF00"
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
|
"_index": 2,
|
||||||
"alignment": 0,
|
"alignment": 0,
|
||||||
"content": {
|
"content": {
|
||||||
"device": "/dev/disk/by-partlabel/disk-main-root",
|
"device": "/dev/disk/by-partlabel/disk-main-root",
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
"efiGptPartitionFirst": true,
|
"efiGptPartitionFirst": true,
|
||||||
"partitions": {
|
"partitions": {
|
||||||
"ESP": {
|
"ESP": {
|
||||||
|
"_index": 2,
|
||||||
"alignment": 0,
|
"alignment": 0,
|
||||||
"content": {
|
"content": {
|
||||||
"device": "/dev/disk/by-partlabel/disk-main-ESP",
|
"device": "/dev/disk/by-partlabel/disk-main-ESP",
|
||||||
@@ -32,6 +33,7 @@
|
|||||||
"type": "EF00"
|
"type": "EF00"
|
||||||
},
|
},
|
||||||
"boot": {
|
"boot": {
|
||||||
|
"_index": 1,
|
||||||
"alignment": 0,
|
"alignment": 0,
|
||||||
"content": null,
|
"content": null,
|
||||||
"device": "/dev/disk/by-partlabel/disk-main-boot",
|
"device": "/dev/disk/by-partlabel/disk-main-boot",
|
||||||
@@ -45,6 +47,7 @@
|
|||||||
"type": "EF02"
|
"type": "EF02"
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
|
"_index": 3,
|
||||||
"alignment": 0,
|
"alignment": 0,
|
||||||
"content": {
|
"content": {
|
||||||
"device": "/dev/disk/by-partlabel/disk-main-root",
|
"device": "/dev/disk/by-partlabel/disk-main-root",
|
||||||
|
|||||||
Reference in new issue
Block a user