modules/nixos: add disko-zfs
This commit is contained in:
parent
cc39102f92
commit
f25792b910
2 changed files with 90 additions and 0 deletions
|
@ -161,6 +161,7 @@
|
|||
builder = ./modules/nixos/builder.nix;
|
||||
community-builder = ./modules/nixos/community-builder;
|
||||
disko-raid = ./modules/nixos/disko-raid.nix;
|
||||
disko-zfs = ./modules/nixos/disko-zfs.nix;
|
||||
github-org-backup = ./modules/nixos/github-org-backup.nix;
|
||||
hercules-ci = ./modules/nixos/hercules-ci;
|
||||
hydra = ./modules/nixos/hydra.nix;
|
||||
|
|
89
modules/nixos/disko-zfs.nix
Normal file
89
modules/nixos/disko-zfs.nix
Normal file
|
@ -0,0 +1,89 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.disko.nixosModules.disko
|
||||
];
|
||||
|
||||
networking.hostId = "deadbeef";
|
||||
|
||||
# this is both efi and bios compatible
|
||||
boot.loader.grub = {
|
||||
enable = true;
|
||||
efiSupport = true;
|
||||
efiInstallAsRemovable = true;
|
||||
};
|
||||
|
||||
disko.devices = {
|
||||
disk = {
|
||||
nvme0n1 = {
|
||||
type = "disk";
|
||||
device = "/dev/nvme0n1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
size = "1M";
|
||||
type = "EF02"; # for grub MBR
|
||||
};
|
||||
ESP = {
|
||||
size = "1G";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "nofail" ];
|
||||
};
|
||||
};
|
||||
zfs = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = "zroot";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
nvme1n1 = {
|
||||
type = "disk";
|
||||
device = "/dev/nvme1n1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
zfs = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = "zroot";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
zpool = {
|
||||
zroot = {
|
||||
type = "zpool";
|
||||
options = {
|
||||
ashift = "12";
|
||||
};
|
||||
rootFsOptions = {
|
||||
acltype = "posixacl";
|
||||
atime = "off";
|
||||
compression = "lz4";
|
||||
mountpoint = "none";
|
||||
xattr = "sa";
|
||||
"com.sun:auto-snapshot" = "false";
|
||||
};
|
||||
datasets = {
|
||||
root = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/";
|
||||
options.mountpoint = "legacy";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue