From d613dee36414595ce3f49c72a0d546d086a7e027 Mon Sep 17 00:00:00 2001 From: Leyla Becker Date: Fri, 7 Nov 2025 17:11:41 -0600 Subject: [PATCH] refactor: move syncthing configs out of flake file --- flake.nix | 3 --- modules/nixos-modules/sync.nix | 4 ++-- util/default.nix | 14 +++++++------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index ee41728..6f85fa3 100644 --- a/flake.nix +++ b/flake.nix @@ -94,7 +94,6 @@ mkNixosSystem = util.mkNixosSystem; mkDarwinSystem = util.mkDarwinSystem; mkHome = util.mkHome; - syncthingConfiguration = util.syncthingConfiguration; nixosSystems = { horizon = mkNixosSystem "horizon"; @@ -170,7 +169,5 @@ darwinConfigurations = darwinSystems; homeConfigurations = homeConfigurations; - - syncthingConfiguration = syncthingConfiguration; }; } diff --git a/modules/nixos-modules/sync.nix b/modules/nixos-modules/sync.nix index bf43041..96f54d5 100644 --- a/modules/nixos-modules/sync.nix +++ b/modules/nixos-modules/sync.nix @@ -1,7 +1,7 @@ { config, lib, - outputs, + syncthingConfiguration, ... }: let mountDir = "/mnt/sync"; @@ -27,7 +27,7 @@ in { configDir = configDir; overrideDevices = true; overrideFolders = true; - configuration = outputs.syncthingConfiguration; + configuration = syncthingConfiguration; deviceName = config.networking.hostName; }; } diff --git a/util/default.nix b/util/default.nix index 1b89169..97bfa49 100644 --- a/util/default.nix +++ b/util/default.nix @@ -52,6 +52,12 @@ home-manager-config ../modules/system-modules ]; + + syncthingConfiguration = nix-syncthing.lib.syncthingConfiguration { + modules = [ + (import ../configurations/syncthing) + ]; + }; in { forEachPkgs = lambda: forEachSystem (system: lambda system (pkgsFor system)); @@ -64,7 +70,7 @@ in { mkNixosSystem = host: nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs util;}; + specialArgs = {inherit inputs outputs util syncthingConfiguration;}; modules = system-modules ++ [ @@ -109,10 +115,4 @@ in { ../configurations/home-manager/${user} ]; }; - - syncthingConfiguration = nix-syncthing.lib.syncthingConfiguration { - modules = [ - (import ../configurations/syncthing) - ]; - }; }