modules/filesystems: include more filesystems
This commit is contained in:
parent
2dd4d9860f
commit
84c03d7152
3 changed files with 35 additions and 22 deletions
35
modules/modules/filesystems.nix
Normal file
35
modules/modules/filesystems.nix
Normal 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;
|
||||
})
|
||||
];
|
||||
}
|
|
@ -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;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue