mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-12 08:00:05 +01:00
lib: read types from subdir
This commit is contained in:
parent
22b33a4fd6
commit
1c31612335
17 changed files with 10 additions and 19 deletions
47
lib/types/zfs.nix
Normal file
47
lib/types/zfs.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{ config, options, lib, diskoLib, ... }:
|
||||
{
|
||||
options = {
|
||||
type = lib.mkOption {
|
||||
type = lib.types.enum [ "zfs" ];
|
||||
internal = true;
|
||||
description = "Type";
|
||||
};
|
||||
pool = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Name of the ZFS pool";
|
||||
};
|
||||
_meta = lib.mkOption {
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
type = lib.types.functionTo diskoLib.jsonType;
|
||||
default = dev: {
|
||||
deviceDependencies.zpool.${config.pool} = [ dev ];
|
||||
};
|
||||
description = "Metadata";
|
||||
};
|
||||
_create = diskoLib.mkCreateOption {
|
||||
inherit config options;
|
||||
default = { dev }: ''
|
||||
echo "${dev}" >> "$disko_devices_dir"/zfs_${config.pool}
|
||||
'';
|
||||
};
|
||||
_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.zfs ];
|
||||
description = "Packages";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue