mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
Add options to support more flexible module configurations. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
36 lines
681 B
Nix
36 lines
681 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.services.tahoe-lafs;
|
|
in
|
|
{
|
|
meta.maintainers = [ lib.maintainers.rycee ];
|
|
|
|
options = {
|
|
services.tahoe-lafs = {
|
|
enable = lib.mkEnableOption "Tahoe-LAFS";
|
|
|
|
package = lib.mkPackageOption pkgs "tahoelafs" { };
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf config.services.tahoe-lafs.enable {
|
|
assertions = [
|
|
(lib.hm.assertions.assertPlatform "services.tahoe-lafs" pkgs lib.platforms.linux)
|
|
];
|
|
|
|
systemd.user.services.tahoe-lafs = {
|
|
Unit = {
|
|
Description = "Tahoe-LAFS";
|
|
};
|
|
|
|
Service = {
|
|
ExecStart = "${lib.getExe' cfg.package "tahoe"} run -C %h/.tahoe";
|
|
};
|
|
};
|
|
};
|
|
}
|