mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-11 23:50:05 +01:00
reimplement disko using the nixos type system
This should make the code cleaner, more robust and errors should be clearer. we also changed the configuration format a bit.
This commit is contained in:
parent
adf901d581
commit
dcb0c42857
11 changed files with 1545 additions and 534 deletions
|
|
@ -1,39 +1,47 @@
|
|||
# usage: nix-instantiate --eval --json --strict example/config.nix | jq .
|
||||
{
|
||||
type = "devices";
|
||||
content = {
|
||||
disk = {
|
||||
vdb = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
{
|
||||
type = "partition";
|
||||
part-type = "primary";
|
||||
start = "1MiB";
|
||||
end = "100%";
|
||||
content = {
|
||||
type = "mdraid";
|
||||
name = "raid1";
|
||||
};
|
||||
}
|
||||
];
|
||||
type = "disk";
|
||||
device = "/dev/vdb";
|
||||
content = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
{
|
||||
type = "partition";
|
||||
name = "mdadm";
|
||||
start = "1MiB";
|
||||
end = "100%";
|
||||
content = {
|
||||
type = "mdraid";
|
||||
name = "raid1";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
vdc = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
{
|
||||
type = "partition";
|
||||
part-type = "primary";
|
||||
start = "1MiB";
|
||||
end = "100%";
|
||||
content = {
|
||||
type = "mdraid";
|
||||
name = "raid1";
|
||||
};
|
||||
}
|
||||
];
|
||||
type = "disk";
|
||||
device = "/dev/vdc";
|
||||
content = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
{
|
||||
type = "partition";
|
||||
name = "mdadm";
|
||||
start = "1MiB";
|
||||
end = "100%";
|
||||
content = {
|
||||
type = "mdraid";
|
||||
name = "raid1";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
mdadm = {
|
||||
raid1 = {
|
||||
type = "mdadm";
|
||||
level = 1;
|
||||
|
|
@ -43,7 +51,7 @@
|
|||
partitions = [
|
||||
{
|
||||
type = "partition";
|
||||
part-type = "primary";
|
||||
name = "primary";
|
||||
start = "1MiB";
|
||||
end = "100%";
|
||||
content = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue