mirror of
https://github.com/nix-community/disko.git
synced 2026-12-01 21:43:29 +01:00
split disko type into multiple files
This commit is contained in:
1 parent
aa26c0ce0d
commit
48e4c06004
21 files changed
+1595
-3
No files matched your search
@@ -0,0 +1,48 @@
|
||||
{ config, options, lib, diskoLib, ... }:
|
||||
{
|
||||
options = {
|
||||
type = lib.mkOption {
|
||||
type = lib.types.enum [ "mdraid" ];
|
||||
internal = true;
|
||||
description = "Type";
|
||||
};
|
||||
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Name";
|
||||
};
|
||||
_meta = lib.mkOption {
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
type = lib.types.functionTo diskoLib.jsonType;
|
||||
default = dev: {
|
||||
deviceDependencies.mdadm.${config.name} = [ dev ];
|
||||
};
|
||||
description = "Metadata";
|
||||
};
|
||||
_create = diskoLib.mkCreateOption {
|
||||
inherit config options;
|
||||
default = { dev }: ''
|
||||
echo "${dev}" >> $disko_devices_dir/raid_${config.name}
|
||||
'';
|
||||
};
|
||||
_mount = diskoLib.mkMountOption {
|
||||
inherit config options;
|
||||
default = { dev }:
|
||||
{ };
|
||||
};
|
||||
_config = lib.mkOption {
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
default = dev: [ ];
|
||||
description = "NixOS configuration";
|
||||
};
|
||||
_pkgs = lib.mkOption {
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
type = lib.types.functionTo (lib.types.listOf lib.types.package);
|
||||
default = pkgs: [ pkgs.mdadm ];
|
||||
description = "Packages";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user