Skip to content

Commit

Permalink
nixos/services.bees: fix eval
Browse files Browse the repository at this point in the history
  • Loading branch information
cmm committed Sep 1, 2024
1 parent a9a40a5 commit 795f102
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions nixos/modules/services/misc/bees.nix
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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.
Expand Down Expand Up @@ -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" ];

Expand Down Expand Up @@ -120,7 +135,7 @@ in
};
unitConfig.RequiresMountsFor = lib.mkIf (lib.hasPrefix "/" fs.spec) fs.spec;
wantedBy = [ "multi-user.target" ];
})
cfg.filesystems;
}
) cfg.filesystems;
};
}

0 comments on commit 795f102

Please sign in to comment.