my system configurations ^-^
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: syncthing (#10)

* feat: syncthing

* remove from brew

* import

* make IDs public

* update

* add sync option

* remove git

authored by

willow and committed by
GitHub
4c867565 4bf00d1c

+72 -2
+6 -1
hosts/earthy/default.nix
··· 11 11 "${self}/modules/nixos" 12 12 ]; 13 13 14 - settings.system.hostName = "earthy"; 14 + settings = { 15 + system = { 16 + hostName = "earthy"; 17 + services.sync.enable = true; 18 + }; 19 + }; 15 20 16 21 # samba 17 22 environment.systemPackages = [pkgs.cifs-utils];
+1
hosts/starling/default.nix
··· 25 25 group = "staff"; 26 26 home = "/Users/${cfg.system.user.name}"; 27 27 }; 28 + services.sync.enable = true; 28 29 }; 29 30 }; 30 31
-1
modules/darwin/homebrew.nix
··· 22 22 "mpd" 23 23 "ncmpcpp" 24 24 "spicetify-cli" 25 - "syncthing" 26 25 "yazi" 27 26 ]; 28 27
+1
modules/shared/home/home.nix
··· 4 4 imports = [ 5 5 ./programs 6 6 ./scripts 7 + ./services 7 8 ./themes 8 9 ]; 9 10
+3
modules/shared/home/services/default.nix
··· 1 + { 2 + imports = [./syncthing.nix]; 3 + }
+56
modules/shared/home/services/syncthing.nix
··· 1 + { 2 + config, 3 + lib, 4 + osConfig, 5 + ... 6 + }: let 7 + cfg = osConfig.settings.system.services.sync; 8 + 9 + devices = { 10 + starling.id = "3NK35IK-ZONOPLB-R277NP3-MUTEU33-PFKOWCZ-U3SB6ZO-YPIBVY5-UTCTIQK"; 11 + earthy.id = "CARNCAO-VNEVXKV-R3NIN2R-APRWTXC-4QCKEVX-ZQI7LZG-GZHAUFU-4XCJYQQ"; 12 + }; 13 + allDevices = builtins.attrNames devices; 14 + in { 15 + # https://github.com/nix-community/home-manager/issues/6542 16 + # syncthing config not applied on switch on darwin 17 + # 18 + # touch ~/Library/Application\ Support/Syncthing/.launchd_update_config 19 + 20 + config = lib.mkIf cfg.enable { 21 + services.syncthing = { 22 + enable = true; 23 + 24 + settings = { 25 + inherit devices; 26 + options = { 27 + urAccepted = -1; # disable usage reporting 28 + relaysEnabled = false; 29 + }; 30 + folders = { 31 + docs = { 32 + label = "Documents"; 33 + devices = allDevices; 34 + path = config.xdg.userDirs.documents; 35 + }; 36 + music = { 37 + label = "Music"; 38 + devices = allDevices; 39 + path = config.xdg.userDirs.music; 40 + }; 41 + pictures = { 42 + label = "Pictures"; 43 + devices = allDevices; 44 + path = config.xdg.userDirs.pictures; 45 + }; 46 + videos = { 47 + label = "Videos"; 48 + devices = allDevices; 49 + path = config.xdg.userDirs.videos; 50 + }; 51 + }; 52 + }; 53 + extraOptions = ["--no-default-folder"]; # don't create default ~/Sync folder 54 + }; 55 + }; 56 + }
+5
modules/shared/options/default.nix
··· 154 154 // { 155 155 default = cfg.system.services.enable; 156 156 }; 157 + sync.enable = 158 + mkEnableOption "Enable syncthing" 159 + // { 160 + default = false; 161 + }; 157 162 printing.enable = 158 163 mkEnableOption "Enable printing" 159 164 // {