diff --git a/components/network/syncthing.nix b/components/network/syncthing.nix index 44ab41e..557e4eb 100644 --- a/components/network/syncthing.nix +++ b/components/network/syncthing.nix @@ -1,7 +1,5 @@ { config, lib, pkgs, factsGenerator, clanLib, ... }: let - syncthingPub = clanLib.readFact "syncthing.pub"; - zerotierIp = clanLib.readFact "zerotier-ip"; clanMachines = lib.mapAttrs (machine: facts: { @@ -18,28 +16,12 @@ with lib; { clanCore.facts.services.syncthing = factsGenerator.syncthing { }; services.syncthing = { - #guiAddress = lib.mkDefault "${config.networking.hostName}.${config.clan.static-hosts.topLevelDomain}:8384"; - #guiAddress = lib.mkDefault "[${zerotierIp config.networking.hostName}]:8384"; guiAddress = lib.mkDefault "${config.networking.hostName}.private:8384"; overrideDevices = lib.mkDefault true; key = config.clanCore.facts.services.syncthing.secret."syncthing.key".path; cert = config.clanCore.facts.services.syncthing.secret."syncthing.cert".path; settings.devices = let - zeroDevice = machine: { - "${machine}" = { - name = machine; - id = syncthingPub machine; - addresses = [ "tcp://[${zerotierIp machine}]:22000" ]; - }; - }; - tincDevice = machine: { - "${machine}" = { - name = machine; - id = syncthingPub machine; - addresses = [ "tcp://${machine}.private:22000" ]; - }; - }; device = machine: id: { "${machine}" = { name = machine; @@ -49,10 +31,6 @@ with lib; { }; in clanMachines - - #// (device "mobi" ) - #// (device "bobi" ) - // (device "iPhone" "APFS6SA-VVTARXU-3WHHRZG-TE5N3T4-X4IC76V-T67EKZ6-NLGP3TW-EZYXYAH") // (device "iPad" "JDDNVYD-H3WMSSS-WZ745KL-7QEGN6O-ZSGQLQU-YBR2L42-7FO7KJ4-BXPYDA5") // (device "bumba" "JS7PWTO-VKFGBUP-GNFLSWP-MGFJ2KH-HLO2LKW-V3RPCR6-PCB5SQC-42FCKQZ") @@ -119,6 +97,12 @@ with lib; { params.keep = "10"; }; }; + # to share big stuff public + share = { + enable = lib.mkDefault false; + path = lib.mkDefault "/tmp/password-store"; + devices = [ "cream" "cherry" "orbi" ]; + }; # todo remove if zfs is is used #nextcloud_backup = { # enable = lib.mkDefault false; diff --git a/homes/palo/taskwarrior.nix b/homes/palo/taskwarrior.nix index e178aba..5f0de7b 100644 --- a/homes/palo/taskwarrior.nix +++ b/homes/palo/taskwarrior.nix @@ -32,6 +32,7 @@ in # bugwarrior (a bit fiddly) imports = [{ + options.bugwarrior.config = mkMagicMergeOption { type = attrs; default = { }; @@ -58,40 +59,42 @@ in ]; })) ]; - }; }]; - home.packages = with pkgs; - [ + config = mkIf config.gui.enable { - taskwarrior - taskwarrior-tui + home.packages = with pkgs; + [ - timewarrior - tasksh - taskwarrior-hooks - (pkgs.writeShellScriptBin "tsak" ''${pkgs.taskwarrior}/bin/task "$@"'') + taskwarrior + taskwarrior-tui - vit - (pkgs.writers.writeBashBin "active" "${taskwarrior-tui}/bin/taskwarrior-tui -r active") - (pkgs.writers.writeBashBin "todo" "${taskwarrior-tui}/bin/taskwarrior-tui -r todo") + timewarrior + tasksh + taskwarrior-hooks + (pkgs.writeShellScriptBin "tsak" ''${pkgs.taskwarrior}/bin/task "$@"'') - (pkgs.writers.writeBashBin "calendar" '' - ${pkgs.taskwarrior}/bin/task calendar - ${pkgs.taskwarrior}/bin/task calendar_report - '') + vit + (pkgs.writers.writeBashBin "active" "${taskwarrior-tui}/bin/taskwarrior-tui -r active") + (pkgs.writers.writeBashBin "todo" "${taskwarrior-tui}/bin/taskwarrior-tui -r todo") - # todo : belongs to calendar.nix - vdirsyncer - khal - (pkgs.writers.writeBashBin "kalendar" '' - ${pkgs.vdirsyncer}/bin/vdirsyncer sync - ${pkgs.khal}/bin/ikhal - '') + (pkgs.writers.writeBashBin "calendar" '' + ${pkgs.taskwarrior}/bin/task calendar + ${pkgs.taskwarrior}/bin/task calendar_report + '') - ]; + # todo : belongs to calendar.nix + vdirsyncer + khal + (pkgs.writers.writeBashBin "kalendar" '' + ${pkgs.vdirsyncer}/bin/vdirsyncer sync + ${pkgs.khal}/bin/ikhal + '') + ]; + + }; } diff --git a/machines/cherry/syncthing.nix b/machines/cherry/syncthing.nix index f8eb2e8..2417a3f 100644 --- a/machines/cherry/syncthing.nix +++ b/machines/cherry/syncthing.nix @@ -37,6 +37,11 @@ enable = true; path = "/home/palo/finance"; }; + share = { + enable = true; + path = "/home/palo/share"; + type = "sendonly"; + }; # no need to be encrypted # ----------------------- diff --git a/machines/cream/syncthing.nix b/machines/cream/syncthing.nix index 023fad6..e065eed 100644 --- a/machines/cream/syncthing.nix +++ b/machines/cream/syncthing.nix @@ -41,6 +41,11 @@ enable = true; path = "/home/palo/finance"; }; + share = { + enable = true; + path = "/home/palo/share"; + type = "sendonly"; + }; # no need to be encrypted # ----------------------- diff --git a/machines/orbi/media-syncthing.nix b/machines/orbi/media-syncthing.nix index 05503e2..c926e1c 100644 --- a/machines/orbi/media-syncthing.nix +++ b/machines/orbi/media-syncthing.nix @@ -1,7 +1,7 @@ { config, pkgs, lib, ... }: { - networking.firewall.allowedTCPPorts = [ 22000 ]; - networking.firewall.allowedUDPPorts = [ 22000 ]; + #networking.firewall.allowedTCPPorts = [ 22000 ]; + #networking.firewall.allowedUDPPorts = [ 22000 ]; services.syncthing = { enable = true; @@ -26,6 +26,11 @@ type = "receiveonly"; path = "/media/syncthing/flix"; }; + share = { + enable = true; + type = "receiveonly"; + path = "/media/syncthing/share"; + }; }; };