From 7e3743d47042cf30ce3270ebd31905c5f7a484e6 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 7 Jan 2025 20:55:58 +0000 Subject: [PATCH] Make syncthing configurable per host --- nix/home/opdavies/hosts/PW05CH3L.nix | 1 + nix/home/opdavies/hosts/lemp11.nix | 1 + nix/home/opdavies/hosts/nixedo.nix | 1 + .../home-manager/features/cli/syncthing.nix | 15 ++++++++++++++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/nix/home/opdavies/hosts/PW05CH3L.nix b/nix/home/opdavies/hosts/PW05CH3L.nix index a2f8c14..91f7832 100644 --- a/nix/home/opdavies/hosts/PW05CH3L.nix +++ b/nix/home/opdavies/hosts/PW05CH3L.nix @@ -2,6 +2,7 @@ features = { cli = { direnv.enable = true; + syncthing.enable = true; tmux-sessionizer.enable = true; }; diff --git a/nix/home/opdavies/hosts/lemp11.nix b/nix/home/opdavies/hosts/lemp11.nix index c253023..1a47292 100644 --- a/nix/home/opdavies/hosts/lemp11.nix +++ b/nix/home/opdavies/hosts/lemp11.nix @@ -4,6 +4,7 @@ features = { cli = { direnv.enable = true; + syncthing.enable = true; tmux-sessionizer.enable = true; }; diff --git a/nix/home/opdavies/hosts/nixedo.nix b/nix/home/opdavies/hosts/nixedo.nix index ef00c48..2eaac9f 100644 --- a/nix/home/opdavies/hosts/nixedo.nix +++ b/nix/home/opdavies/hosts/nixedo.nix @@ -4,6 +4,7 @@ features = { cli = { direnv.enable = true; + syncthing.enable = true; }; desktop = { diff --git a/nix/modules/home-manager/features/cli/syncthing.nix b/nix/modules/home-manager/features/cli/syncthing.nix index d496e5e..094ff2c 100644 --- a/nix/modules/home-manager/features/cli/syncthing.nix +++ b/nix/modules/home-manager/features/cli/syncthing.nix @@ -1 +1,14 @@ -{ services.syncthing.enable = true; } +{ config, lib, ... }: + +with lib; + +let + cfg = config.features.cli.syncthing; +in +{ + options.features.cli.syncthing.enable = mkEnableOption "Enable syncthing"; + + config = mkIf cfg.enable { + services.syncthing.enable = true; + }; +}