18 current 2025-10-05 21:47:39 25.05.20251001.5b5be50 6.12.49 *

This commit is contained in:
2025-10-05 21:47:42 -05:00
parent ac173b25e1
commit fcdf8e1562
3 changed files with 20 additions and 20 deletions

View File

@@ -1,6 +1,6 @@
# flake for blakes nixos config # flake for blakes nixos config
# define new devices in outputs # define new devices in outputs
# generation: 16 current 2025-10-05 21:36:22 25.05.20251001.5b5be50 6.12.49 * # generation: 18 current 2025-10-05 21:47:39 25.05.20251001.5b5be50 6.12.49 *
{ {
description = "blakes nix config"; description = "blakes nix config";
inputs = { inputs = {

View File

@@ -15,7 +15,7 @@
sops.enable = true; sops.enable = true;
docker.enable = true; docker.enable = true;
syncthing.enable = true; syncthing.enable = true;
syncthing.mode = "server"; # syncthing.mode = "server";
tailscale.enable = true; tailscale.enable = true;
nvidia.enable = true; nvidia.enable = true;
}; };

View File

@@ -7,32 +7,32 @@ in
options.modules.system.syncthing = { options.modules.system.syncthing = {
enable = lib.mkEnableOption "enables syncthing"; enable = lib.mkEnableOption "enables syncthing";
mode = lib.mkOption { # mode = lib.mkOption {
type = lib.types.enum [ "server" "client" ]; # type = lib.types.enum [ "server" "client" ];
default = "client"; # default = "client";
description = "whether syncthing should run as a client (user) or server (system-wide)."; # description = "whether syncthing should run as a client (user) or server (system-wide).";
}; # };
#
data_dir = lib.mkOption { # data_dir = lib.mkOption {
type = lib.types.str; # type = lib.types.str;
default = if cfg.mode == "server" # default = if cfg.mode == "server"
then "/var/lib/syncthing" # then "/var/lib/syncthing"
else "/home/blake/.local/state/syncthing"; # else "/home/blake/.local/state/syncthing";
description = "optional override for syncthing data directory."; # description = "optional override for syncthing data directory.";
}; # };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
systemd.tmpfiles.rules = lib.optionals (cfg.mode == "server") ["d /var/lib/syncthing 0775 blake blake -"]; # systemd.tmpfiles.rules = lib.optionals (cfg.mode == "server") ["d /var/lib/syncthing 0775 blake blake -"];
services.syncthing = { services.syncthing = {
enable = true; enable = true;
user = if cfg.mode == "server" then "blake" else "blake"; # user = "blake";
group = if cfg.mode == "server" then "blake" else "blake"; # group = "blake";
dataDir = cfg.data_dir; # dataDir = "/var/lib/syncthing";
guiAddress = "0.0.0.0:2222"; guiAddress = "0.0.0.0:2222";
openDefaultPorts = true; # openDefaultPorts = true;
}; };
}; };
} }