Initialize quasar
This commit is contained in:
parent
60579facc7
commit
211af9bd61
15 changed files with 616 additions and 72 deletions
113
linux/quasar/disko.nix
Normal file
113
linux/quasar/disko.nix
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
{...}: {
|
||||
disko.devices = {
|
||||
# Partition the physical disk
|
||||
disk = {
|
||||
active = {
|
||||
type = "disk";
|
||||
device = "/dev/nvme0n1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
esp = {
|
||||
size = "2G";
|
||||
type = "ef00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = ["umask=0077"];
|
||||
};
|
||||
};
|
||||
zfs = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = "zactive";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
archive = {
|
||||
type = "disk";
|
||||
device = "/dev/sda";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions.zfs = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = "zarchive";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Declare zfs pools for this system.
|
||||
zpool = let
|
||||
options = {
|
||||
ashift = "12";
|
||||
autotrim = "on";
|
||||
listsnapshots = "on";
|
||||
};
|
||||
rootFsOptions = {
|
||||
acltype = "posix";
|
||||
atime = "off";
|
||||
compression = "zstd";
|
||||
dnodesize = "auto";
|
||||
mountpoint = "none";
|
||||
normalization = "formD";
|
||||
xattr = "sa";
|
||||
};
|
||||
in {
|
||||
zactive = {
|
||||
type = "zpool";
|
||||
inherit options rootFsOptions;
|
||||
datasets = {
|
||||
# Encrypt main dataset
|
||||
main = {
|
||||
type = "zfs_fs";
|
||||
options = {
|
||||
encryption = "on";
|
||||
keyformat = "passphrase";
|
||||
};
|
||||
};
|
||||
# Create dataset for home
|
||||
"main/home" = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/home";
|
||||
};
|
||||
# Create dataset for nix store
|
||||
"main/nix" = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/nix";
|
||||
};
|
||||
# Create dataset for root
|
||||
"main/root" = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/";
|
||||
};
|
||||
# Reserve space for performance
|
||||
reservation = {
|
||||
type = "zfs_fs";
|
||||
options.refreservation = "256G";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
zarchive = {
|
||||
type = "zpool";
|
||||
inherit options rootFsOptions;
|
||||
datasets = {
|
||||
snapshot.type = "zfs_fs";
|
||||
# Reserve space for performance
|
||||
reservation = {
|
||||
type = "zfs_fs";
|
||||
options.refreservation = "512G";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue