lib.types: turn _create, _mount and _config into values

This commit is contained in:
lassulus 2023-07-01 19:02:01 +02:00 committed by mergify[bot]
parent 8002e7cb89
commit ab9b880db2
17 changed files with 194 additions and 146 deletions

View file

@ -1,4 +1,4 @@
{ config, options, lib, diskoLib, parent, ... }:
{ config, options, lib, diskoLib, parent, device, ... }:
{
options = {
type = lib.mkOption {
@ -6,6 +6,11 @@
internal = true;
description = "Type";
};
device = lib.mkOption {
type = lib.types.str;
description = "Device";
default = device;
};
name = lib.mkOption {
type = lib.types.str;
@ -26,19 +31,18 @@
};
_create = diskoLib.mkCreateOption {
inherit config options;
default = { dev }: ''
echo "${dev}" >> "$disko_devices_dir"/raid_${config.name}
default = ''
echo "${config.device}" >> "$disko_devices_dir"/raid_${config.name}
'';
};
_mount = diskoLib.mkMountOption {
inherit config options;
default = { dev }:
{ };
default = { };
};
_config = lib.mkOption {
internal = true;
readOnly = true;
default = _dev: [ ];
default = [ ];
description = "NixOS configuration";
};
_pkgs = lib.mkOption {