back to plain attrset for disko

This commit is contained in:
Noah Masur 2023-02-25 10:02:54 -05:00
parent 80d0451ff3
commit 67af160088
2 changed files with 153 additions and 155 deletions

View File

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