53 current 2025-10-05 14:13:26 25.05.20251001.5b5be50 6.12.49 *
This commit is contained in:
@@ -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: 50 current 2025-10-05 12:15:30 25.05.20251001.5b5be50 6.12.49 *
|
# generation: 53 current 2025-10-05 14:13:26 25.05.20251001.5b5be50 6.12.49 *
|
||||||
{
|
{
|
||||||
description = "blakes nix config";
|
description = "blakes nix config";
|
||||||
inputs = {
|
inputs = {
|
||||||
|
|||||||
@@ -14,7 +14,8 @@
|
|||||||
ssh.enable = true;
|
ssh.enable = true;
|
||||||
sops.enable = true;
|
sops.enable = true;
|
||||||
docker.enable = true;
|
docker.enable = true;
|
||||||
syncthing.enable = true;
|
syncthing.enable = false;
|
||||||
|
syncthing.mode = "server";
|
||||||
tailscale.enable = true;
|
tailscale.enable = true;
|
||||||
nvidia.enable = false;
|
nvidia.enable = false;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,6 +6,24 @@ in
|
|||||||
{
|
{
|
||||||
options.modules.system.syncthing = {
|
options.modules.system.syncthing = {
|
||||||
enable = lib.mkEnableOption "enables syncthing";
|
enable = lib.mkEnableOption "enables syncthing";
|
||||||
|
|
||||||
|
mode = lib.mkOption {
|
||||||
|
type = lib.types.enum [ "server" "client" ];
|
||||||
|
default = "client";
|
||||||
|
description = "whether syncthing should run as a client (user) or server (system-wide).";
|
||||||
|
};
|
||||||
|
|
||||||
|
data_dir = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "/var/lib/syncthing";
|
||||||
|
description = "optional override for syncthing data directory.";
|
||||||
|
};
|
||||||
|
|
||||||
|
config_dir = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "/var/lib/syncthing/config";
|
||||||
|
description = "optional override for syncthing config directory.";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
@@ -14,8 +32,8 @@ in
|
|||||||
user = "blake";
|
user = "blake";
|
||||||
group = "blake";
|
group = "blake";
|
||||||
|
|
||||||
dataDir = "/home/blake/.local/state/syncthing";
|
dataDir = cfg.data_dir or (if cfg.mode == "server" then "/var/lib/syncthing" else "/home/blake/.local/state/syncthing");
|
||||||
configDir = "/home/blake/.config/syncthing";
|
configDir = cfg.config_dir or (if cfg.mode == "server" then "/var/lib/syncthing/config" else "/home/blake/.config/syncthing");
|
||||||
|
|
||||||
# webui
|
# webui
|
||||||
guiAddress = "0.0.0.0:2222";
|
guiAddress = "0.0.0.0:2222";
|
||||||
|
|||||||
Reference in New Issue
Block a user