filesystems/btrfs: add btrfs module

This commit is contained in:
Infinidoge 2021-12-02 17:27:12 -05:00
parent 6bb529af81
commit f9c78cbc2e
2 changed files with 21 additions and 10 deletions

View file

@ -0,0 +1,21 @@
{ 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;
};
}