Created
May 4, 2024 05:25
-
-
Save glukki/5ec2aa879cff458919d18de5e3fd52a1 to your computer and use it in GitHub Desktop.
Setting up Resilio Sync on NixOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, lib, pkgs, ... }: | |
let sharedDirectory = "/var/www/midlib"; | |
in { | |
# Network | |
networking = { | |
firewall.allowedTCPPorts = [ 4444 ]; # let connect directly to Resilio Sync | |
}; | |
# System | |
nixpkgs.config.allowUnfree = true; # required to install Resilio Sync | |
# Services | |
services.resilio = { | |
enable = true; | |
enableWebUI = false; | |
checkForUpdates = false; | |
downloadLimit = 0; | |
uploadLimit = 0; | |
deviceName = "a pretty name for other users"; | |
listeningPort = 4444; | |
}; | |
systemd.tmpfiles.rules = [ | |
"d ${sharedDirectory} 0775 rslsync rslsync -" # create directory for Resilio Sync files | |
]; | |
services.resilio.sharedFolders = [{ | |
secret = "the key"; # I want to make a mirror on the server, so the read-only key works perfectly | |
directory = sharedDirectory; | |
knownHosts = []; | |
useRelayServer = true; | |
useTracker = true; | |
useDHT = true; | |
searchLAN = true; | |
useSyncTrash = true; | |
}]; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment