dotfiles/modules/os/core/fs/default.nix
eriedaberrie 6dcab51c42 Initial commit
Note: not the actual initial commit.

I swear I will stop repeatedly force pushing to this single commit eventually
ok.
2024-08-24 09:08:28 -07:00

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";}
];
};
}