mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-12 16:10:03 +01:00
turn disk configs into valid nixos configuration
This commit is contained in:
parent
cd825b85fb
commit
769bde0834
24 changed files with 1152 additions and 1186 deletions
|
|
@ -22,8 +22,7 @@ let
|
|||
(lib.attrNames (builtins.readDir ./.))
|
||||
);
|
||||
|
||||
allTests = lib.genAttrs allTestFilenames (test: import (./. + "/${test}.nix") { inherit makeDiskoTest pkgs; }) //
|
||||
evalTest "lvm-luks-example" ../example/config.nix // {
|
||||
allTests = lib.genAttrs allTestFilenames (test: import (./. + "/${test}.nix") { inherit makeDiskoTest pkgs; }) // {
|
||||
standalone = (pkgs.nixos [ ../example/stand-alone/configuration.nix ]).config.system.build.toplevel;
|
||||
};
|
||||
in
|
||||
|
|
|
|||
|
|
@ -30,16 +30,16 @@
|
|||
tsp-mount = (tsp-generator.mountScript (import disko-config { disks = builtins.tail disks; inherit lib; })) pkgs;
|
||||
tsp-disko = (tsp-generator.zapCreateMountScript (import disko-config { disks = builtins.tail disks; inherit lib; })) pkgs;
|
||||
tsp-config = tsp-generator.config (import disko-config { inherit disks; inherit lib; });
|
||||
num-disks = builtins.length (lib.attrNames (import disko-config { inherit lib; }).disk);
|
||||
num-disks = builtins.length (lib.attrNames (import disko-config { inherit lib; }).disko.devices.disk);
|
||||
installed-system = { modulesPath, ... }: {
|
||||
imports = [
|
||||
(lib.optionalAttrs (testMode == "direct" || testMode == "cli") tsp-config)
|
||||
(lib.optionalAttrs (testMode == "module") {
|
||||
imports = [ ../module.nix ];
|
||||
disko = {
|
||||
enableConfig = true;
|
||||
devices = import disko-config { inherit disks lib; };
|
||||
};
|
||||
disko.enableConfig = true;
|
||||
imports = [
|
||||
../module.nix
|
||||
(import disko-config { inherit disks lib; })
|
||||
];
|
||||
})
|
||||
(modulesPath + "/testing/test-instrumentation.nix")
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
|
|
@ -77,11 +77,13 @@
|
|||
nodes.machine = { config, pkgs, modulesPath, ... }: {
|
||||
imports = [
|
||||
(lib.optionalAttrs (testMode == "module") {
|
||||
imports = [ ../module.nix ];
|
||||
imports = [
|
||||
../module.nix
|
||||
];
|
||||
disko = {
|
||||
enableConfig = false;
|
||||
checkScripts = true;
|
||||
devices = import disko-config { disks = builtins.tail disks; inherit lib; };
|
||||
devices = (import disko-config { disks = builtins.tail disks; inherit lib; }).disko.devices;
|
||||
};
|
||||
})
|
||||
(lib.optionalAttrs (testMode == "cli") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue