modules/filesystems: include more filesystems

This commit is contained in:
Infinidoge 2021-12-03 22:09:00 -05:00
parent 2dd4d9860f
commit 84c03d7152
3 changed files with 35 additions and 22 deletions

View file

@ -0,0 +1,35 @@
{ config, options, lib, pkgs, ... }:
with lib;
with lib.hlissner;
let
cfg = config.modules.filesystems;
opt = options.modules.filesystems;
in
{
options.modules.filesystems = {
enable = mkBoolOpt false;
btrfs = with types; {
enable = mkBoolOpt false;
scrub = mkOpt attrs { };
};
};
config = mkMerge [
(mkIf cfg.enable {
programs.udevil.enable = true;
environment.systemPackages = with pkgs; [
sshfs
exfat # Windows drives
ntfs3g # Windows drives
];
})
(mkIf cfg.btrfs.enable {
environment.systemPackages = with pkgs; [ btrfs-progs ];
services.btrfs.autoScrub = mkAliasDefinitions opt.scrub;
})
];
}

View file

@ -1,21 +0,0 @@
{ config, options, lib, pkgs, ... }:
with lib;
with lib.hlissner;
let
cfg = config.modules.filesystems.btrfs;
opt = options.modules.filesystems.btrfs;
in
{
options.modules.filesystems.btrfs = with types; {
enable = mkBoolOpt false;
scrub = mkOpt attrs { };
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
btrfs-progs
];
services.btrfs.autoScrub = mkAliasDefinitions opt.scrub;
};
}