Add jupiter base
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
137
hosts/jupiter/format.nix
Normal file
137
hosts/jupiter/format.nix
Normal file
@@ -0,0 +1,137 @@
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
# TODO: Set to correct device
|
||||
device = "/dev/vda";
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
name = "boot";
|
||||
size = "1M";
|
||||
type = "EF02";
|
||||
};
|
||||
esp = {
|
||||
name = "esp";
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
# TODO: Set correct swap size and enable
|
||||
# swap = {
|
||||
# name = "swap";
|
||||
# size = "64G";
|
||||
# content = {
|
||||
# type = "swap";
|
||||
# resumeDevice = true;
|
||||
# };
|
||||
# };
|
||||
root = {
|
||||
name = "root";
|
||||
size = "100%";
|
||||
content = {
|
||||
name = "main";
|
||||
type = "luks";
|
||||
passwordFile = "/tmp/keyfile";
|
||||
settings = {
|
||||
allowDiscards = true;
|
||||
};
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes =
|
||||
let
|
||||
mountOptions = [
|
||||
"compress=zstd:1"
|
||||
"noatime"
|
||||
];
|
||||
in
|
||||
{
|
||||
"@" = {
|
||||
mountpoint = "/";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@persist" = {
|
||||
mountpoint = "/persist";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@nix" = {
|
||||
mountpoint = "/nix";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@cache" = {
|
||||
mountpoint = "/cache";
|
||||
inherit mountOptions;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
storage0 = {
|
||||
# TODO: Set to correct device
|
||||
device = "/dev/vdb";
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
root = {
|
||||
name = "root";
|
||||
size = "100%";
|
||||
content = {
|
||||
name = "storage0";
|
||||
type = "luks";
|
||||
passwordFile = "/tmp/keyfile";
|
||||
settings = {
|
||||
allowDiscards = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
storage1 = {
|
||||
# TODO: Set to correct device
|
||||
device = "/dev/vdc";
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
root = {
|
||||
name = "root";
|
||||
size = "100%";
|
||||
content = {
|
||||
name = "storage1";
|
||||
type = "luks";
|
||||
passwordFile = "/tmp/keyfile";
|
||||
settings = {
|
||||
allowDiscards = true;
|
||||
};
|
||||
|
||||
# storageN content must be placed on last alphabetical drive
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f -L storage -m raid1 -d raid1 /dev/mapper/storage0" ];
|
||||
subvolumes = {
|
||||
"@" = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user