Add disko config for hypnos
This commit is contained in:
parent
f96b946cb2
commit
732d92c7e7
@ -13,7 +13,7 @@
|
|||||||
### Disks
|
### Disks
|
||||||
Device | Partitions _(filesystem, size, usage)_
|
Device | Partitions _(filesystem, size, usage)_
|
||||||
--- | ---
|
--- | ---
|
||||||
Apple SSD SM0512F | `/dev/nvme01` (ZFS, 500 GiB, NixOS Root)
|
Apple SSD SM0512F | `/dev/sda1` (EFI, 256 MiB, NixOS Boot) <br> `/dev/sda2` (ZFS, 500 GiB, NixOS Root)
|
||||||
|
|
||||||
#### ZFS pool layout
|
#### ZFS pool layout
|
||||||
```
|
```
|
||||||
|
123
hosts/hypnos/disko-config.nix
Normal file
123
hosts/hypnos/disko-config.nix
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
{
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
main = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/disk/by-id/ata-APPLE_SSD_SM0512F_S1K5NYBF736152";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
ESP = {
|
||||||
|
size = "256M";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
zfs = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "zfs";
|
||||||
|
pool = "rpool";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
zpool = {
|
||||||
|
rpool = {
|
||||||
|
type = "zpool";
|
||||||
|
options = {
|
||||||
|
ashift = "12";
|
||||||
|
};
|
||||||
|
rootFsOptions = {
|
||||||
|
canmount = "off";
|
||||||
|
mountpoint = "none";
|
||||||
|
dnodesize = "auto";
|
||||||
|
xattr = "sa";
|
||||||
|
};
|
||||||
|
mountpoint = "/";
|
||||||
|
postCreateHook = "zfs snapshot zroot@blank";
|
||||||
|
datasets = {
|
||||||
|
local = {
|
||||||
|
options = {
|
||||||
|
mountpoint = "none";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"local/nix" = {
|
||||||
|
mountpoint = "/nix";
|
||||||
|
options = {
|
||||||
|
atime = "off";
|
||||||
|
mountpoint = "legacy";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"local/tmp" = {
|
||||||
|
mountpoint = "/tmp";
|
||||||
|
options = {
|
||||||
|
setuid = "off";
|
||||||
|
devices = "off";
|
||||||
|
mountpoint = "legacy";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
system = {
|
||||||
|
options = {
|
||||||
|
mountpoint = "none";
|
||||||
|
encryption = "aes-256-gcm";
|
||||||
|
keyformat = "passphrase";
|
||||||
|
keylocation = "file:///tmp/secret.key";
|
||||||
|
};
|
||||||
|
# use this to read the key during boot
|
||||||
|
postCreateHook = ''
|
||||||
|
zfs set keylocation="prompt" "rpool/$name";
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
"system/var" = {
|
||||||
|
mountpoint = "/var";
|
||||||
|
options = {
|
||||||
|
mountpoint = "legacy";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"system/var/tmp" = {
|
||||||
|
mountpoint = "/var/tmp";
|
||||||
|
options = {
|
||||||
|
devices = "off";
|
||||||
|
mountpoint = "legacy";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"system/var/log" = {
|
||||||
|
mountpoint = "/var/log";
|
||||||
|
options = {
|
||||||
|
compression = "on";
|
||||||
|
acltype = "posix";
|
||||||
|
mountpoint = "legacy";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
user = {
|
||||||
|
options = {
|
||||||
|
mountpoint = "none";
|
||||||
|
encryption = "aes-256-gcm";
|
||||||
|
keyformat = "passphrase";
|
||||||
|
keylocation = "file:///tmp/secret.key";
|
||||||
|
};
|
||||||
|
# use this to read the key during boot
|
||||||
|
postCreateHook = ''
|
||||||
|
zfs set keylocation="prompt" "rpool/$name";
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
"user/home" = {
|
||||||
|
mountpoint = "/home";
|
||||||
|
options = {
|
||||||
|
setuid = "off";
|
||||||
|
devices = "off";
|
||||||
|
mountpoint = "legacy";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user