back to disko module once again

This commit is contained in:
Noah Masur 2023-02-25 10:22:24 -05:00
parent 67af160088
commit b1b5e77f47
2 changed files with 165 additions and 163 deletions

View File

@ -10,6 +10,7 @@ nixpkgs.lib.nixosSystem {
specialArgs = { }; specialArgs = { };
modules = [ modules = [
./hardware-configuration.nix ./hardware-configuration.nix
./disks.nix
../../modules/common ../../modules/common
../../modules/nixos ../../modules/nixos
(removeAttrs globals [ "mail.server" ]) (removeAttrs globals [ "mail.server" ])
@ -17,7 +18,6 @@ nixpkgs.lib.nixosSystem {
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
disko.nixosModules.disko disko.nixosModules.disko
{ {
disko.devices = import ./disks.nix;
server = true; server = true;
gui.enable = false; gui.enable = false;
theme = { colors = (import ../../colorscheme/gruvbox).dark; }; theme = { colors = (import ../../colorscheme/gruvbox).dark; };

View File

@ -1,166 +1,168 @@
{ { ... }: {
disk = { disko.devices = {
boot = { disk = {
type = "disk"; boot = {
device = "/dev/nvme0n1"; type = "disk";
content = { device = "/dev/nvme0n1";
type = "table"; content = {
format = "gpt"; type = "table";
partitions = [ format = "gpt";
{ partitions = [
type = "partition"; {
name = "ESP"; type = "partition";
start = "0"; name = "ESP";
end = "512MiB"; start = "0";
fs-type = "fat32"; end = "512MiB";
bootable = true; fs-type = "fat32";
content = { bootable = true;
type = "filesystem"; content = {
format = "vfat"; type = "filesystem";
mountpoint = "/boot"; format = "vfat";
}; mountpoint = "/boot";
} };
{ }
type = "partition"; {
name = "root"; type = "partition";
start = "512MiB"; name = "root";
end = "100%"; start = "512MiB";
part-type = "primary"; end = "100%";
bootable = true; part-type = "primary";
content = { bootable = true;
type = "filesystem"; content = {
format = "ext4"; type = "filesystem";
mountpoint = "/"; format = "ext4";
}; mountpoint = "/";
} };
]; }
}; ];
}; };
sda = { };
type = "disk"; sda = {
device = "/dev/sda"; type = "disk";
content = { device = "/dev/sda";
type = "table"; content = {
format = "gpt"; type = "table";
partitions = [{ format = "gpt";
type = "partition"; partitions = [{
name = "zfs"; type = "partition";
start = "128MiB"; name = "zfs";
end = "100%"; start = "128MiB";
content = { end = "100%";
type = "zfs"; content = {
pool = "tank"; type = "zfs";
}; pool = "tank";
}]; };
}; }];
}; };
sdb = { };
type = "disk"; sdb = {
device = "/dev/sdb"; type = "disk";
content = { device = "/dev/sdb";
type = "table"; content = {
format = "gpt"; type = "table";
partitions = [{ format = "gpt";
type = "partition"; partitions = [{
name = "zfs"; type = "partition";
start = "128MiB"; name = "zfs";
end = "100%"; start = "128MiB";
content = { end = "100%";
type = "zfs"; content = {
pool = "tank"; type = "zfs";
}; pool = "tank";
}]; };
}; }];
}; };
sdc = { };
type = "disk"; sdc = {
device = "/dev/sdc"; type = "disk";
content = { device = "/dev/sdc";
type = "table"; content = {
format = "gpt"; type = "table";
partitions = [{ format = "gpt";
type = "partition"; partitions = [{
name = "zfs"; type = "partition";
start = "128MiB"; name = "zfs";
end = "100%"; start = "128MiB";
content = { end = "100%";
type = "zfs"; content = {
pool = "tank"; type = "zfs";
}; pool = "tank";
}]; };
}; }];
}; };
}; };
zpool = { };
tank = { zpool = {
type = "zpool"; tank = {
mode = "raidz1"; type = "zpool";
rootFsOptions = { mode = "raidz1";
compression = "on"; # lz4 by default rootFsOptions = {
"com.sun:auto-snapshot" = "false"; compression = "on"; # lz4 by default
ashift = 12; "com.sun:auto-snapshot" = "false";
}; ashift = "12";
# mountpoint = "/"; };
# mountpoint = "/";
datasets = {
media = { datasets = {
zfs_type = "filesystem"; media = {
mountpoint = "none"; zfs_type = "filesystem";
options."com.sun:auto-snapshot" = "false"; mountpoint = "/media";
options."com.sun:auto-snapshot" = "false";
};
# "media/movies" = {
# zfs_type = "filesystem";
# mountpoint = "/media/movies";
# options.recordsize = "1M";
# };
# "media/tv" = {
# zfs_type = "filesystem";
# mountpoint = "/media/tv";
# options.recordsize = "1M";
# };
# "media/books" = {
# zfs_type = "filesystem";
# mountpoint = "/media/books";
# };
# archive = {
# zfs_type = "filesystem";
# mountpoint = "/archive";
# options.compression = "zstd";
# options."com.sun:auto-snapshot" = "true";
# };
# zfs_unmounted_fs = {
# zfs_type = "filesystem";
# options.mountpoint = "none";
# };
# zfs_legacy_fs = {
# zfs_type = "filesystem";
# options.mountpoint = "legacy";
# mountpoint = "/zfs_legacy_fs";
# };
# zfs_testvolume = {
# zfs_type = "volume";
# size = "10M";
# content = {
# type = "filesystem";
# format = "ext4";
# mountpoint = "/ext4onzfs";
# };
# };
# encrypted = {
# zfs_type = "filesystem";
# size = "20M";
# options = {
# mountpoint = "none";
# encryption = "aes-256-gcm";
# keyformat = "passphrase";
# keylocation = "file:///tmp/secret.key";
# };
# };
# "encrypted/test" = {
# zfs_type = "filesystem";
# size = "2M";
# mountpoint = "/zfs_crypted";
# };
}; };
# "media/movies" = {
# zfs_type = "filesystem";
# mountpoint = "/media/movies";
# options.recordsize = "1M";
# };
# "media/tv" = {
# zfs_type = "filesystem";
# mountpoint = "/media/tv";
# options.recordsize = "1M";
# };
# "media/books" = {
# zfs_type = "filesystem";
# mountpoint = "/media/books";
# };
# archive = {
# zfs_type = "filesystem";
# mountpoint = "/archive";
# options.compression = "zstd";
# options."com.sun:auto-snapshot" = "true";
# };
# zfs_unmounted_fs = {
# zfs_type = "filesystem";
# options.mountpoint = "none";
# };
# zfs_legacy_fs = {
# zfs_type = "filesystem";
# options.mountpoint = "legacy";
# mountpoint = "/zfs_legacy_fs";
# };
# zfs_testvolume = {
# zfs_type = "volume";
# size = "10M";
# content = {
# type = "filesystem";
# format = "ext4";
# mountpoint = "/ext4onzfs";
# };
# };
# encrypted = {
# zfs_type = "filesystem";
# size = "20M";
# options = {
# mountpoint = "none";
# encryption = "aes-256-gcm";
# keyformat = "passphrase";
# keylocation = "file:///tmp/secret.key";
# };
# };
# "encrypted/test" = {
# zfs_type = "filesystem";
# size = "2M";
# mountpoint = "/zfs_crypted";
# };
}; };
}; };
}; };