dotfiles/modules/hardware/fs.nix

41 lines
733 B
Nix
Raw Permalink Normal View History

2022-01-11 18:44:40 +01:00
{ config, options, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.hardware.fs;
in {
options.modules.hardware.fs = {
enable = mkOption {
type = types.bool;
default = false;
};
ssd.enable = mkOption {
type = types.bool;
default = false;
};
2022-04-23 03:01:00 +02:00
xfs.enable = mkOption {
type = types.bool;
default = false;
};
2022-01-11 18:44:40 +01:00
};
config = mkIf cfg.enable (mkMerge [
{
environment.systemPackages = with pkgs; [
sshfs
];
}
(mkIf cfg.ssd.enable {
services.fstrim.enable = true;
environment.systemPackages = with pkgs; [
nvme-cli
];
2022-01-11 18:44:40 +01:00
})
2022-04-23 03:01:00 +02:00
(mkIf cfg.xfs.enable {
boot.supportedFilesystems = [ "xfs" ];
})
2022-01-11 18:44:40 +01:00
]);
}