mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-11 23:50:05 +01:00
lib.types: turn _create, _mount and _config into values
This commit is contained in:
parent
8002e7cb89
commit
ab9b880db2
17 changed files with 194 additions and 146 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue