-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f1260f
commit fc6876a
Showing
1 changed file
with
152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
{ config, disks ? [ "/dev/nvme0n1" "/dev/nvme1n1" "/dev/sda" ], ... }: | ||
let | ||
defaultBtrfsOpts = [ "defaults" "compress=zstd:1" "ssd" "noatime" "nodiratime" ]; | ||
in | ||
{ | ||
disko.devices = { | ||
disk = { | ||
nvme0 = { | ||
device = builtins.elemAt disks 0; | ||
type = "disk"; | ||
content = { | ||
type = "table"; | ||
format = "gpt"; | ||
partitions = { | ||
EFI = { | ||
priority = 1; | ||
name = "EFI"; | ||
start = "0%"; | ||
end = "1024MiB"; | ||
bootable = true; | ||
type = "EF00"; | ||
content = { | ||
type = "filesystem"; | ||
format = "vfat"; | ||
mountpoint = "/boot"; | ||
}; | ||
}; | ||
root = { | ||
name = "NixOS"; | ||
end = "-16G"; | ||
content = { | ||
type = "btrfs"; | ||
name = "NixOS"; | ||
extraOpenArgs = [ "--allow-discards" ]; | ||
|
||
content = { | ||
type = "btrfs"; | ||
# Override existing partition | ||
extraArgs = [ "-f" ]; | ||
|
||
subvolumes = { | ||
"@" = { | ||
mountpoint = "/"; | ||
mountOptions = defaultBtrfsOpts; | ||
}; | ||
"@home" = { | ||
mountpoint = "/home"; | ||
mountOptions = defaultBtrfsOpts; | ||
}; | ||
"@nix" = { | ||
mountpoint = "/nix"; | ||
mountOptions = defaultBtrfsOpts; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
swap = { | ||
size = "100%"; | ||
content = { | ||
type = "swap"; | ||
randomEncryption = true; | ||
resumeDevice = true; # resume from hiberation from this device | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
nvme1 = { | ||
device = builtins.elemAt disks 1; | ||
type = "disk"; | ||
content = { | ||
type = "table"; | ||
format = "gpt"; | ||
partitions = { | ||
root = { | ||
size = "100%"; | ||
type = "btrfs"; | ||
name = "Linux"; | ||
|
||
content = { | ||
type = "btrfs"; | ||
# Override existing partition | ||
extraArgs = [ "-f" ]; | ||
subvolumes = { }; | ||
}; | ||
|
||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
sda = { | ||
device = builtins.elemAt disks 2; | ||
type = "disk"; | ||
content = { | ||
type = "table"; | ||
format = "gpt"; | ||
partitions = { | ||
root = { | ||
size = "100%"; | ||
type = "btrfs"; | ||
name = "BtrProductive"; | ||
|
||
content = { | ||
type = "btrfs"; | ||
# Override existing partition | ||
extraArgs = [ "-f" ]; | ||
|
||
subvolumes = { | ||
"@games" = { | ||
mountpoint = "/mnt/games"; | ||
mountOptions = defaultBtrfsOpts; | ||
}; | ||
"@kvm" = { | ||
mountpoint = "/mnt/kvm"; | ||
mountOptions = defaultBtrfsOpts; | ||
}; | ||
"@steam" = { | ||
mountpoint = "/mnt/steam"; | ||
mountOptions = defaultBtrfsOpts; | ||
}; | ||
"@userdata/@documents" = { | ||
mountpoint = "/home/${config.snowfallorg.user.name}/Documents"; | ||
mountOptions = defaultBtrfsOpts; | ||
}; | ||
"@userdata/@downloads" = { | ||
mountpoint = "/home/${config.snowfallorg.user.name}/Downloads"; | ||
mountOptions = defaultBtrfsOpts; | ||
}; | ||
"@userdata/@music" = { | ||
mountpoint = "/home/${config.snowfallorg.user.name}/Music"; | ||
mountOptions = defaultBtrfsOpts; | ||
}; | ||
"@userdata/@pictures" = { | ||
mountpoint = "/home/${config.snowfallorg.user.name}/Pictures"; | ||
mountOptions = defaultBtrfsOpts; | ||
}; | ||
"@userdata/@videos" = { | ||
mountpoint = "/home/${config.snowfallorg.user.name}/Videos"; | ||
mountOptions = defaultBtrfsOpts; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |