mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-22 08:04:25 +01:00
Enable syncthing server on alto
This commit is contained in:
parent
da7a7b7328
commit
896549c6fb
2 changed files with 24 additions and 8 deletions
|
|
@ -8,10 +8,12 @@ in
|
||||||
myConfig = {
|
myConfig = {
|
||||||
boot.loader.systemdBoot.enable = true;
|
boot.loader.systemdBoot.enable = true;
|
||||||
sops.enable = true;
|
sops.enable = true;
|
||||||
|
|
||||||
tailscale = {
|
tailscale = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ssh.enable = true;
|
ssh.enable = true;
|
||||||
exitNode.enable = true;
|
exitNode.enable = true;
|
||||||
|
|
||||||
serve = {
|
serve = {
|
||||||
isFunnel = true;
|
isFunnel = true;
|
||||||
target = "localhost:${toString myConfig.hedgedoc.port}";
|
target = "localhost:${toString myConfig.hedgedoc.port}";
|
||||||
|
|
@ -42,5 +44,9 @@ in
|
||||||
backups.enable = true;
|
backups.enable = true;
|
||||||
subdomain = config.networking.hostName;
|
subdomain = config.networking.hostName;
|
||||||
};
|
};
|
||||||
|
syncthing = {
|
||||||
|
enable = true;
|
||||||
|
isServer = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,29 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.myConfig.syncthing;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
options.myConfig.syncthing.enable = lib.mkEnableOption "";
|
options.myConfig.syncthing = {
|
||||||
|
enable = lib.mkEnableOption "";
|
||||||
config = lib.mkIf config.myConfig.syncthing.enable {
|
isServer = lib.mkEnableOption "";
|
||||||
networking.firewall.interfaces.tailscale0.allowedTCPPorts = [ 22000 ];
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
services.syncthing = {
|
services.syncthing = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
user = "seb";
|
user = lib.mkIf (!cfg.isServer) "seb";
|
||||||
group = "users";
|
group = lib.mkIf (!cfg.isServer) "users";
|
||||||
dataDir = "/home/seb";
|
dataDir = lib.mkIf (!cfg.isServer) "/home/seb";
|
||||||
|
|
||||||
|
guiAddress = lib.mkIf cfg.isServer "0.0.0.0:8384";
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
devices = {
|
devices = {
|
||||||
|
alto = {
|
||||||
|
id = "5R2MH7T-Q2ZZS2P-ZMSQ2UJ-B6VBHES-XYLNMZ6-7FYC27L-4P7MGJ2-FY4ITQD";
|
||||||
|
addresses = [ "tcp://alto.${config.networking.domain}:22000" ];
|
||||||
|
};
|
||||||
fern = {
|
fern = {
|
||||||
id = "Q4YPD3V-GXZPHSN-PT5X4PU-FBG4GX2-IASBX75-7NYMG75-4EJHBMZ-4WGDDAP";
|
id = "Q4YPD3V-GXZPHSN-PT5X4PU-FBG4GX2-IASBX75-7NYMG75-4EJHBMZ-4WGDDAP";
|
||||||
addresses = [ "tcp://fern.${config.networking.domain}:22000" ];
|
addresses = [ "tcp://fern.${config.networking.domain}:22000" ];
|
||||||
|
|
@ -29,7 +39,7 @@
|
||||||
genFolders =
|
genFolders =
|
||||||
folders:
|
folders:
|
||||||
lib.genAttrs folders (name: {
|
lib.genAttrs folders (name: {
|
||||||
path = "~/${name}";
|
path = "${config.services.syncthing.dataDir}/${name}";
|
||||||
ignorePerms = false;
|
ignorePerms = false;
|
||||||
devices = lib.attrNames config.services.syncthing.settings.devices;
|
devices = lib.attrNames config.services.syncthing.settings.devices;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue