nixos/hosts/common/disks/default.nix

12 lines
513 B
Nix

{ device, fsType, encrypted, ... }:
let
# 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; };
in
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