Refactor persistence structure
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -74,7 +74,7 @@ cat <<'EOF' > "./hosts/$host/format.nix"
|
||||
{
|
||||
disko.devices = {
|
||||
disk.main = {
|
||||
device = ""; # Set this to the device you want to install to
|
||||
device = ""; # TODO: Set this to the device you want to install to
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
@@ -95,6 +95,14 @@ cat <<'EOF' > "./hosts/$host/format.nix"
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
swap = {
|
||||
name = "swap";
|
||||
size = ""; # TODO: Set this to the swap size you want
|
||||
content = {
|
||||
type = "swap";
|
||||
resumeDevice = true;
|
||||
};
|
||||
};
|
||||
root = {
|
||||
name = "root";
|
||||
size = "100%";
|
||||
@@ -108,32 +116,39 @@ cat <<'EOF' > "./hosts/$host/format.nix"
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = [ "-f" ];
|
||||
subvolumes = {
|
||||
"@" = {
|
||||
mountpoint = "/";
|
||||
};
|
||||
"@persist" = {
|
||||
mountpoint = "/persist";
|
||||
subvolumes =
|
||||
let
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"compress=zstd:1"
|
||||
"noatime"
|
||||
];
|
||||
in
|
||||
{
|
||||
"@" = {
|
||||
mountpoint = "/";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@persist" = {
|
||||
mountpoint = "/persist";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@persist/user" = {
|
||||
mountpoint = "/persist/user";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@persist/state" = {
|
||||
mountpoint = "/persist/state";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@persist/cache" = {
|
||||
mountpoint = "/persist/cache";
|
||||
inherit mountOptions;
|
||||
};
|
||||
"@nix" = {
|
||||
mountpoint = "/nix";
|
||||
inherit mountOptions;
|
||||
};
|
||||
};
|
||||
"@nix" = {
|
||||
mountpoint = "/nix";
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
"@cache" = {
|
||||
mountpoint = "/cache";
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user