mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-12 16:10:03 +01:00
commit
7dce65dd28
2 changed files with 15 additions and 1 deletions
|
|
@ -31,6 +31,8 @@ let {
|
||||||
config.lvm = q: x:
|
config.lvm = q: x:
|
||||||
foldl' recursiveUpdate {} (mapAttrsToList (name: config-f { inherit name; vgname = x.name; }) x.lvs);
|
foldl' recursiveUpdate {} (mapAttrsToList (name: config-f { inherit name; vgname = x.name; }) x.lvs);
|
||||||
|
|
||||||
|
config.noop = q: x: {};
|
||||||
|
|
||||||
config.partition = q: x:
|
config.partition = q: x:
|
||||||
config-f { device = q.device + toString q.index; } x.content;
|
config-f { device = q.device + toString q.index; } x.content;
|
||||||
|
|
||||||
|
|
@ -65,6 +67,8 @@ let {
|
||||||
${concatStrings (mapAttrsToList (name: create-f { inherit name; vgname = x.name; }) x.lvs)}
|
${concatStrings (mapAttrsToList (name: create-f { inherit name; vgname = x.name; }) x.lvs)}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
create.noop = q: x: "";
|
||||||
|
|
||||||
create.partition = q: x: ''
|
create.partition = q: x: ''
|
||||||
parted -s ${q.device} mkpart ${x.part-type} ${x.fs-type or ""} ${x.start} ${x.end}
|
parted -s ${q.device} mkpart ${x.part-type} ${x.fs-type or ""} ${x.start} ${x.end}
|
||||||
${optionalString (x.bootable or false) ''
|
${optionalString (x.bootable or false) ''
|
||||||
|
|
@ -119,6 +123,8 @@ let {
|
||||||
'';}
|
'';}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
mount.noop = q: x: {};
|
||||||
|
|
||||||
mount.partition = q: x:
|
mount.partition = q: x:
|
||||||
mount-f { device = q.device + toString q.index; } x.content;
|
mount-f { device = q.device + toString q.index; } x.content;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,13 +56,20 @@ import <nixpkgs/nixos/tests/make-test.nix> ({ pkgs, ... }: let
|
||||||
};
|
};
|
||||||
home = {
|
home = {
|
||||||
type = "lv";
|
type = "lv";
|
||||||
size = "100M";
|
size = "10M";
|
||||||
content = {
|
content = {
|
||||||
type = "filesystem";
|
type = "filesystem";
|
||||||
format = "ext4";
|
format = "ext4";
|
||||||
mountpoint = "/home";
|
mountpoint = "/home";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
raw = {
|
||||||
|
type = "lv";
|
||||||
|
size = "10M";
|
||||||
|
content = {
|
||||||
|
type = "noop";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -92,6 +99,7 @@ in {
|
||||||
$machine->succeed("echo 'secret' > /tmp/secret.key");
|
$machine->succeed("echo 'secret' > /tmp/secret.key");
|
||||||
$machine->succeed("${pkgs.writeScript "create" ((import ../lib).create disko-config)}");
|
$machine->succeed("${pkgs.writeScript "create" ((import ../lib).create disko-config)}");
|
||||||
$machine->succeed("${pkgs.writeScript "mount" ((import ../lib).mount disko-config)}");
|
$machine->succeed("${pkgs.writeScript "mount" ((import ../lib).mount disko-config)}");
|
||||||
|
$machine->succeed("test -b /dev/mapper/pool-raw");
|
||||||
'';
|
'';
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue