filesystems/btrfs: add btrfs module
This commit is contained in:
parent
6bb529af81
commit
f9c78cbc2e
2 changed files with 21 additions and 10 deletions
21
modules/modules/filesystems/btrfs.nix
Normal file
21
modules/modules/filesystems/btrfs.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,10 +0,0 @@
|
||||||
{ pkgs, lib, ... }: {
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
btrfs-progs
|
|
||||||
];
|
|
||||||
|
|
||||||
services.btrfs.autoScrub = {
|
|
||||||
enable = lib.mkDefault false;
|
|
||||||
interval = "monthly";
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue