feat: Declarative K3S node
This commit is contained in:
1 parent
02b2b9cf32
commit
62cc03dad1
5 files changed
+239
-5
No files matched your search
@@ -0,0 +1,82 @@
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/sda";
|
||||
imageSize = "32G"; # For test VMs
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
zfs = {
|
||||
end = "-4G";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = "tank";
|
||||
};
|
||||
};
|
||||
swap = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "swap";
|
||||
discardPolicy = "both";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
longhorn = {
|
||||
type = "disk";
|
||||
device = "/dev/sdb";
|
||||
imageSize = "64G"; # For longhorn storage
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
main = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
zpool = {
|
||||
tank = {
|
||||
type = "zpool";
|
||||
rootFsOptions = {
|
||||
compression = "zstd";
|
||||
};
|
||||
mountpoint = null;
|
||||
postCreateHook = "zfs snapshot -r tank@blank && zfs hold -r blank tank@blank";
|
||||
|
||||
datasets = {
|
||||
root = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/";
|
||||
};
|
||||
nix = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/nix";
|
||||
};
|
||||
persist = {
|
||||
type = "zfs_fs";
|
||||
mountpoint = "/persist";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -75,6 +75,7 @@ in
|
||||
zip
|
||||
unzip
|
||||
tmux
|
||||
unixtools.net-tools
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -20,7 +20,7 @@ in
|
||||
profiles.base.enable = true;
|
||||
disko = {
|
||||
enable = true;
|
||||
profile = "vm";
|
||||
profile = mkDefault "vm";
|
||||
};
|
||||
impermanence = {
|
||||
enable = true;
|
||||
|
||||
Reference in new issue
Block a user