6e6b52ae3c
Note: not the actual initial commit. I swear I will stop repeatedly force pushing to this single commit eventually ok.
43 lines
855 B
Nix
43 lines
855 B
Nix
{ config, lib, ... }:
|
|
|
|
let
|
|
cfg = config.my.fs;
|
|
in {
|
|
imports = [
|
|
./btrfs.nix
|
|
./ext4.nix
|
|
./luks.nix
|
|
./ssd.nix
|
|
];
|
|
|
|
options.my.fs = {
|
|
bootPartition = lib.mkEnableOption null // {
|
|
default = true;
|
|
};
|
|
device = lib.mkOption {
|
|
type = lib.types.path;
|
|
default = "/dev/disk/by-label/nixos";
|
|
};
|
|
snapshots = lib.mkEnableOption null;
|
|
swapPartition = lib.mkEnableOption null;
|
|
type = lib.mkOption {
|
|
type = with lib.types; nullOr (enum [ "btrfs" "ext4" ]);
|
|
default = null;
|
|
};
|
|
};
|
|
|
|
config = {
|
|
fileSystems = lib.mkIf cfg.bootPartition {
|
|
"/boot" = {
|
|
device = "/dev/disk/by-label/BOOT";
|
|
fsType = "vfat";
|
|
options = [ "umask=0077" ];
|
|
};
|
|
};
|
|
|
|
swapDevices = lib.mkIf cfg.swapPartition [
|
|
{device = "/dev/disk/by-label/swap";}
|
|
];
|
|
};
|
|
}
|