mirror of
https://github.com/tuxdotrs/nixos-config.git
synced 2025-07-06 17:56:35 +05:30
add disko
This commit is contained in:
48
hosts/canopus/disko.nix
Normal file
48
hosts/canopus/disko.nix
Normal file
@ -0,0 +1,48 @@
|
||||
{device ? throw "Set this to the disk device, e.g. /dev/nvme0n1", ...}: {
|
||||
disko.devices.disk.primary = {
|
||||
inherit device;
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt"; # GPT partitioning scheme
|
||||
partitions = {
|
||||
# EFI Partition
|
||||
ESP = {
|
||||
size = "512M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = ["defaults" "umask=0077"];
|
||||
};
|
||||
};
|
||||
# Btrfs Root Partition
|
||||
root = {
|
||||
size = "100%"; # Use remaining space
|
||||
type = "8300"; # Linux filesystem type
|
||||
content = {
|
||||
type = "btrfs";
|
||||
subvolumes = {
|
||||
"/root" = {
|
||||
mountOptions = ["compress=zstd"]; # Compression for better performance
|
||||
mountpoint = "/"; # Root subvolume
|
||||
};
|
||||
"/persistent" = {
|
||||
mountOptions = ["compress=zstd"]; # Compression for persistent data
|
||||
mountpoint = "/persistent"; # Persistent subvolume
|
||||
};
|
||||
"/nix" = {
|
||||
mountOptions = [
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
"noacl"
|
||||
]; # Optimize for Nix store
|
||||
mountpoint = "/nix"; # Nix subvolume
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user