nixos/hosts/common/disks/default.nix

12 lines
513 B
Nix
Raw Normal View History

2024-05-27 15:04:34 +01:00
{ device, fsType, encrypted, ... }:
let
2024-05-27 15:42:50 +01:00
# basic and perists configs. basic fs = ext4, persist fs = btrfs either encrypted or under lvm
basic = import ./gpt-bios-compact.nix { inherit device; };
btrfs-persist-lvm = import ./btrfs-lvm.nix { inherit device; };
btrfs-persist-luks = import ./btrfs-luks.nix { inherit device; };
2024-05-27 15:04:34 +01:00
in
2024-05-27 15:42:50 +01:00
if fsType == "ext4" then basic
else if fsType == "btrfs" && encrypted then btrfs-persist-luks
else if fsType == "btrfs" then btrfs-persist-lvm
else null # or some default value