mirror of
https://github.com/nix-community/disko
synced 2024-11-10 06:14:14 +00:00
module: expose diskoTest via system.build
This commit is contained in:
parent
bfc300b1c2
commit
4cad47f3fa
1 changed files with 19 additions and 1 deletions
20
module.nix
20
module.nix
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, pkgs, extendModules, ... }@args:
|
||||
let
|
||||
diskoLib = import ./lib {
|
||||
inherit lib;
|
||||
|
@ -34,6 +34,16 @@ in
|
|||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
tests = {
|
||||
efi = lib.mkOption {
|
||||
description = ''
|
||||
Whether efi is enabled for the `system.build.installTest`.
|
||||
We try to automatically detect efi based on the configured bootloader.
|
||||
'';
|
||||
type = lib.types.bool;
|
||||
default = config.boot.loader.systemd-boot.enable || config.boot.loader.grub.efiSupport;
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf (cfg.devices.disk != { }) {
|
||||
system.build = (cfg.devices._scripts { inherit pkgs; checked = cfg.checkScripts; }) // {
|
||||
|
@ -41,6 +51,14 @@ in
|
|||
# we keep this old outputs for compatibility
|
||||
disko = builtins.trace "the .disko output is deprecated, plase use .diskoScript instead" cfg.devices._scripts.diskoScript;
|
||||
diskoNoDeps = builtins.trace "the .diskoNoDeps output is deprecated, plase use .diskoScriptNoDeps instead" cfg.devices._scripts.diskoScriptNoDeps;
|
||||
|
||||
installTest = diskoLib.testLib.makeDiskoTest {
|
||||
inherit extendModules pkgs;
|
||||
name = "${config.networking.hostName}-disko";
|
||||
disko-config = builtins.removeAttrs config ["_module"];
|
||||
testMode = "direct";
|
||||
efi = cfg.tests.efi;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue