nixos configs
at main 40 lines 966 B view raw
1{ config, lib, ... }: 2 3with lib; 4let 5 cfg = config.dots.syncthing; 6 dataDir = "${config.home.homeDirectory}/sync"; 7in 8{ 9 options.dots.syncthing = { 10 enable = mkEnableOption "enable syncthing"; 11 }; 12 13 config = mkIf cfg.enable { 14 services.syncthing = { 15 enable = true; 16 extraOptions = [ 17 "--config" 18 "${dataDir}/.config/syncthing" 19 "--data" 20 "${dataDir}" 21 "--no-default-folder" 22 ]; 23 overrideFolders = true; 24 overrideDevices = true; 25 settings = { 26 options.urAccepted = -1; 27 devices = { 28 # kharbranth = { id = "FX6KDKI-UPZE5RA-KEL7OX7-WER52KY-6WVQ6CY-HNK3UX3-23W3CEK-3HWTMAY"; }; 29 # shadesmar = { id = "QWXKQOD-JWPR4VE-KQBV47P-HU33L32-TTKOG75-6LKCKGG-PJH3CQ2-SVNHMAR"; }; 30 }; 31 folders = { 32 # work = { 33 # path = "~/sync/work"; 34 # devices = [ "kharbranth" "shadesmar" ]; 35 # }; 36 }; 37 }; 38 }; 39 }; 40}