From 8da17cb0d5350f08af3b50fe8c59bd94d27c38aa Mon Sep 17 00:00:00 2001 From: punkfairie Date: Sat, 16 Nov 2024 21:29:25 -0800 Subject: [PATCH] feat(home): Syncthing --- homes/x86_64-linux/marley@nyx/default.nix | 1 + modules/home/services/syncthing/default.nix | 32 +++++++++++++++++++++ old/home/services/syncthing.nix | 12 -------- 3 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 modules/home/services/syncthing/default.nix delete mode 100644 old/home/services/syncthing.nix diff --git a/homes/x86_64-linux/marley@nyx/default.nix b/homes/x86_64-linux/marley@nyx/default.nix index c548cb2..c503861 100644 --- a/homes/x86_64-linux/marley@nyx/default.nix +++ b/homes/x86_64-linux/marley@nyx/default.nix @@ -54,6 +54,7 @@ in clipboard = enabled; # TODO: bundle this with the WM under xorg dunst = enabled; + syncthing = enabled; }; xorg = { xsession = enabled; diff --git a/modules/home/services/syncthing/default.nix b/modules/home/services/syncthing/default.nix new file mode 100644 index 0000000..72f4982 --- /dev/null +++ b/modules/home/services/syncthing/default.nix @@ -0,0 +1,32 @@ +{ + lib, + config, + namespace, + pkgs, + ... +}: +let + inherit (lib) mkIf; + inherit (lib.${namespace}) mkEnableModule; + + cfg = config.${namespace}.services.syncthing; +in +{ + options = mkEnableModule "services.syncthing"; + + config = mkIf cfg.enable { + home.packages = [ + config.services.syncthing.tray.package + ]; + + services.syncthing = { + enable = true; + + tray = { + enable = true; + command = "syncthingtray"; + package = pkgs.syncthingtray-minimal; + }; + }; + }; +} diff --git a/old/home/services/syncthing.nix b/old/home/services/syncthing.nix deleted file mode 100644 index b0843c9..0000000 --- a/old/home/services/syncthing.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ... }: -{ - services.syncthing = { - enable = true; - - tray = { - enable = true; - command = "syncthingtray"; - package = pkgs.syncthingtray-minimal; - }; - }; -}