Skip to content

Instantly share code, notes, and snippets.

@glukki
Created May 4, 2024 05:25
Show Gist options
  • Save glukki/5ec2aa879cff458919d18de5e3fd52a1 to your computer and use it in GitHub Desktop.
Save glukki/5ec2aa879cff458919d18de5e3fd52a1 to your computer and use it in GitHub Desktop.
Setting up Resilio Sync on NixOS
{ 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