diff --git a/machine-confs/helium.nix b/machine-confs/helium.nix index 1ac02e3..a2812d8 100644 --- a/machine-confs/helium.nix +++ b/machine-confs/helium.nix @@ -1,30 +1,4 @@ { config, pkgs, lib, ... }: -let -unison-conf = "${pkgs.writeText "unison-conf" -'' -root = /home/vili -root = ssh://nixos-cpu.vsinerva.fi//home/vili - -watch = true -repeat = watch -prefer = newer -diff = diff -y -W 79 --suppress-common-lines -copyprog = rsync --inplace --compress -copyprogrest = rsync --partial --inplace --compress sshargs = -C - -path = Desktop -path = Documents -path = Downloads -path = Music -path = Pictures -path = Projects -path = Public -path = School -path = Templates -path = Videos -path = Zotero -''}"; -in { networking = { hostName = "helium"; @@ -71,6 +45,7 @@ in imports = [ ../base.nix ../vili.nix + ../syncthing.nix ../desktop.nix ../development.nix ../misc/libinput.nix @@ -91,30 +66,6 @@ in zenmonitor moonlight-qt parsec-bin via ]; - systemd.services = { - unisonConfSymlink = { - wantedBy = [ "multi-user.target" ]; - description = "Symlink for unison conf"; - serviceConfig = { - Type = "oneshot"; - User = "vili"; - ExecStartPre = ''${pkgs.coreutils-full}/bin/mkdir -p /home/vili/.unison''; - ExecStart = ''${pkgs.coreutils-full}/bin/ln -sf ${unison-conf} /home/vili/.unison/cpu.prf''; - }; - }; - unisonSync = { - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; - description = "unison filesync"; - serviceConfig = { - Type = "exec"; - User = "vili"; - ExecStart = ''${pkgs.unison}/bin/unison -sshcmd ${pkgs.openssh}/bin/ssh cpu''; - }; - }; - }; - - # HARDWARE SPECIFIC boot.initrd.kernelModules = [ "amdgpu" ]; hardware = { diff --git a/machine-confs/nixos-cpu.nix b/machine-confs/nixos-cpu.nix index d2c02b3..1233895 100644 --- a/machine-confs/nixos-cpu.nix +++ b/machine-confs/nixos-cpu.nix @@ -6,6 +6,7 @@ ../base.nix ../development.nix ../vili.nix + ../syncthing.nix ]; # HARDWARE SPECIFIC diff --git a/syncthing.nix b/syncthing.nix new file mode 100644 index 0000000..9ced0b0 --- /dev/null +++ b/syncthing.nix @@ -0,0 +1,39 @@ +# Syncthing instance +{ config, pkgs, ... }: +{ + services.syncthing = { + enable = true; + user = "vili"; + dataDir = "/home/vili/"; + + settings = { + devices = { + }; + + folders = + let + default = { + devices = []; + versioning = { + type = "trashcan"; + params.cleanoutDays = "30"; + }; + }; + in + { + "~/Desktop" = default; + }; + + options = { + urAccepted = -1; + localAnnounceEnabled = false; + globalAnnounceEnabled = false; + natEnabled = false; + relaysEnabled = false; + }; + }; + + #TCP/UDP 22000 for transfers and UDP 21027 for discovery + openDefaultPorts = true; + }; +}