From 795f1020ea9399e70698d4033bffbb220b638c41 Mon Sep 17 00:00:00 2001 From: Michael Livshin Date: Sun, 1 Sep 2024 23:27:37 +0300 Subject: [PATCH] nixos/services.bees: fix eval --- nixos/modules/services/misc/bees.nix | 29 +++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/nixos/modules/services/misc/bees.nix b/nixos/modules/services/misc/bees.nix index 170f92253c635..b16552a8eecdd 100644 --- a/nixos/modules/services/misc/bees.nix +++ b/nixos/modules/services/misc/bees.nix @@ -1,9 +1,23 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let cfg = config.services.beesd; - logLevels = { emerg = 0; alert = 1; crit = 2; err = 3; warning = 4; notice = 5; info = 6; debug = 7; }; + logLevels = { + emerg = 0; + alert = 1; + crit = 2; + err = 3; + warning = 4; + notice = 5; + info = 6; + debug = 7; + }; fsOptions = with lib.types; { options.spec = lib.mkOption { @@ -23,7 +37,7 @@ let example = "LABEL=MyBulkDataDrive"; }; options.hashTableSizeMB = lib.mkOption { - type = lib.types.addCheck lib.types.int (n: mod n 16 == 0); + type = lib.types.addCheck lib.types.int (n: lib.mod n 16 == 0); default = 1024; # 1GB; default from upstream beesd script description = '' Hash table size in MB; must be a multiple of 16. @@ -84,8 +98,9 @@ in }; }; config = { - systemd.services = lib.mapAttrs' - (name: fs: lib.nameValuePair "beesd@${name}" { + systemd.services = lib.mapAttrs' ( + name: fs: + lib.nameValuePair "beesd@${name}" { description = "Block-level BTRFS deduplication for %i"; after = [ "sysinit.target" ]; @@ -120,7 +135,7 @@ in }; unitConfig.RequiresMountsFor = lib.mkIf (lib.hasPrefix "/" fs.spec) fs.spec; wantedBy = [ "multi-user.target" ]; - }) - cfg.filesystems; + } + ) cfg.filesystems; }; }