add boot filesystem option
This commit is contained in:
parent
90cf8be3d2
commit
53dd14e8db
@ -14,6 +14,12 @@ in
|
|||||||
description = "The cpu-type installed on the server.";
|
description = "The cpu-type installed on the server.";
|
||||||
};
|
};
|
||||||
amdGPU = libS.mkOpinionatedOption "the system contains a AMD GPU";
|
amdGPU = libS.mkOpinionatedOption "the system contains a AMD GPU";
|
||||||
|
filesystem = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
example = "btrfs";
|
||||||
|
default = "zfs";
|
||||||
|
description = "The filesystem installed.";
|
||||||
|
};
|
||||||
fullDiskEncryption = libS.mkOpinionatedOption "use luks full disk encrytion";
|
fullDiskEncryption = libS.mkOpinionatedOption "use luks full disk encrytion";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -35,7 +41,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
supportedFilesystems = [ "zfs" ];
|
supportedFilesystems = [ cfg.filesystem ];
|
||||||
tmp.useTmpfs = true;
|
tmp.useTmpfs = true;
|
||||||
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
||||||
kernelParams = [
|
kernelParams = [
|
||||||
@ -43,7 +49,7 @@ in
|
|||||||
] ++ lib.optional (cfg.cpuType == "amd") "kvm-amd"
|
] ++ lib.optional (cfg.cpuType == "amd") "kvm-amd"
|
||||||
++ lib.optional cfg.fullDiskEncryption "ip=<ip-addr>::<ip-gateway>:<netmask>";
|
++ lib.optional cfg.fullDiskEncryption "ip=<ip-addr>::<ip-gateway>:<netmask>";
|
||||||
|
|
||||||
zfs = {
|
zfs = lib.mkIf (cfg.filesystem == "zfs") {
|
||||||
enableUnstable = true;
|
enableUnstable = true;
|
||||||
devNodes = "/dev/disk/by-id/";
|
devNodes = "/dev/disk/by-id/";
|
||||||
forceImportRoot = true;
|
forceImportRoot = true;
|
||||||
@ -57,12 +63,12 @@ in
|
|||||||
grub = {
|
grub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
copyKernels = true;
|
copyKernels = true;
|
||||||
zfsSupport = true;
|
zfsSupport = lib.mkIf (cfg.filesystem == "zfs") true;
|
||||||
efiSupport = true;
|
efiSupport = true;
|
||||||
efiInstallAsRemovable = true;
|
efiInstallAsRemovable = true;
|
||||||
fsIdentifier = "uuid";
|
fsIdentifier = "uuid";
|
||||||
device = "nodev";
|
device = "nodev";
|
||||||
enableCryptodisk = true;
|
enableCryptodisk = lib.mkIf cfg.fullDiskEncryption true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user