nixos/hosts/common/disks/default.nix

12 lines
468 B
Nix
Raw Permalink Normal View History

2024-06-28 20:21:27 +01:00
{ device, fsType, encrypted, impermanence, ... }:
2024-05-27 15:04:34 +01:00
let
2024-06-28 20:21:27 +01:00
fsModule = if impermanence then ./${fsType}/persist.nix else ./${fsType}/standard.nix;
basic = import ./${fsType}/basic.nix { inherit device; };
lvm = import ./lvm.nix { inherit device; fsModule = fsModule; };
luks = import ./luks.nix { inherit device; fsModule = fsModule; };
2024-05-27 15:04:34 +01:00
in
2024-05-27 15:42:50 +01:00
if fsType == "ext4" then basic
2024-06-28 20:21:27 +01:00
else if fsType == "btrfs" && encrypted then luks
else if fsType == "btrfs" then lvm
else null