From e619cc2dab16371f241acc4ae6e52b1f5c47ffa8 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Tue, 3 Sep 2024 18:20:29 +0700 Subject: [PATCH] :wrench: migrate to taskwarrior 3 --- flake.nix | 2 +- homes/palo/taskwarrior.nix | 25 +++++++++++-------- machines/chungus/sync-syncoid.nix | 17 ++++++++----- machines/orbi/configuration.nix | 6 +++-- .../hardware-configuration/disko-config.nix | 13 ++++++++++ machines/orbi/service-taskserver.nix | 21 +++++----------- 6 files changed, 49 insertions(+), 35 deletions(-) diff --git a/flake.nix b/flake.nix index 1eb993d..f11512d 100644 --- a/flake.nix +++ b/flake.nix @@ -142,7 +142,7 @@ inherit (pkgs) lib; machineDir = ./machines; }; - zerotierDeviceName = "ztbn67ogn2"; + zerotierInterface = "ztbn67ogn2"; components = ./components; features = ./features; }; diff --git a/homes/palo/taskwarrior.nix b/homes/palo/taskwarrior.nix index b872dba..fafd4a1 100644 --- a/homes/palo/taskwarrior.nix +++ b/homes/palo/taskwarrior.nix @@ -42,7 +42,10 @@ let valueType; }; - taskwarrior-tui = pkgs.legacy_2311.taskwarrior-tui; + #taskwarrior-tui = pkgs.legacy_2311.taskwarrior-tui; + taskwarrior-tui = pkgs.taskwarrior-tui; + + taskwarrior = pkgs.taskwarrior3; in @@ -87,28 +90,28 @@ in config = mkIf config.gui.enable { - home.packages = with pkgs; [ + home.packages = [ taskwarrior taskwarrior-tui - timewarrior - tasksh - taskwarrior-hooks - (pkgs.writeShellScriptBin "tsak" ''${pkgs.taskwarrior}/bin/task "$@"'') + pkgs.timewarrior + pkgs.tasksh + pkgs.taskwarrior-hooks + (pkgs.writeShellScriptBin "tsak" ''${taskwarrior}/bin/task "$@"'') - vit + pkgs.vit (pkgs.writers.writeBashBin "active" "${taskwarrior-tui}/bin/taskwarrior-tui -r active") (pkgs.writers.writeBashBin "todo" "${taskwarrior-tui}/bin/taskwarrior-tui -r todo") (pkgs.writers.writeBashBin "calendar" '' - ${pkgs.taskwarrior}/bin/task calendar - ${pkgs.taskwarrior}/bin/task calendar_report + ${taskwarrior}/bin/task calendar + ${taskwarrior}/bin/task calendar_report '') # todo : belongs to calendar.nix - vdirsyncer - khal + pkgs.vdirsyncer + pkgs.khal (pkgs.writers.writeBashBin "kalendar" '' ${pkgs.vdirsyncer}/bin/vdirsyncer sync ${pkgs.khal}/bin/ikhal diff --git a/machines/chungus/sync-syncoid.nix b/machines/chungus/sync-syncoid.nix index 531311f..1181e17 100644 --- a/machines/chungus/sync-syncoid.nix +++ b/machines/chungus/sync-syncoid.nix @@ -25,32 +25,37 @@ in # local commands.service2 = { source = "zroot/services2"; - target = "zraid/mirror/services2"; # should not be created up front! + target = "zraid/mirror/services2"; # should NOT be created up front! }; commands.paperless = { source = "zroot/paperless"; - target = "zraid/mirror/paperless"; # should not be created up front! + target = "zraid/mirror/paperless"; # should NOT be created up front! }; commands.postgresql = { source = "zroot/postgresql"; - target = "zraid/mirror/postgresql"; # should not be created up front! + target = "zraid/mirror/postgresql"; # should NOT be created up front! }; # remote commands.matrix-terranix = { sshKey = "/run/facts/ssh.syncoid.id_ed25519"; source = "root@orbi.${tld}:zroot/matrix-terranix"; - target = "zraid/mirror/matrix-terranix"; # should not be created up front! + target = "zraid/mirror/matrix-terranix"; # should NOT be created up front! }; commands.nextcloud = { sshKey = "/run/facts/ssh.syncoid.id_ed25519"; source = "root@orbi.${tld}:zroot/nextcloud"; - target = "zraid/mirror/nextcloud"; # should not be created up front! + target = "zraid/mirror/nextcloud"; # should NOT be created up front! }; commands.photoprism = { sshKey = "/run/facts/ssh.syncoid.id_ed25519"; source = "root@orbi.${tld}:zmedia/photoprism"; - target = "zraid/mirror/photoprism"; # should not be created up front! + target = "zraid/mirror/photoprism"; # should NOT be created up front! + }; + commands.taskchampion = { + sshKey = "/run/facts/ssh.syncoid.id_ed25519"; + source = "root@orbi.${tld}:zroot/taskchampion"; + target = "zraid/mirror/taskchampion"; # should NOT be created up front! }; commonArgs = [ # Does not create new snapshot, only transfers existing diff --git a/machines/orbi/configuration.nix b/machines/orbi/configuration.nix index f6bb6ec..875906d 100644 --- a/machines/orbi/configuration.nix +++ b/machines/orbi/configuration.nix @@ -19,10 +19,10 @@ ./service-hedgedoc.nix ./service-nix-cache.nix ./service-photoprism.nix - #./service-surrealdb.nix # not really needed at the moment +# ./service-surrealdb.nix # not really needed at the moment ./service-taskserver.nix ./service-vaultwarden.nix - ./service-vikunja.nix +# ./service-vikunja.nix ./service-wastebin.nix ./nginx-ingolf-wagner-de.nix @@ -45,6 +45,8 @@ ]; + networking.firewall.enable = true; + services.logrotate.checkConfig = false; # because uid 3000 does not exist in here networking.hostName = "orbi"; diff --git a/machines/orbi/hardware-configuration/disko-config.nix b/machines/orbi/hardware-configuration/disko-config.nix index 9c0c639..2a16043 100644 --- a/machines/orbi/hardware-configuration/disko-config.nix +++ b/machines/orbi/hardware-configuration/disko-config.nix @@ -137,6 +137,19 @@ in #"com.sun:auto-snapshot:monthly" = toString true; }; }; + "taskchampion" = { + type = "zfs_fs"; + mountpoint = config.services.taskchampion-sync-server.dataDir; + # "/var/lib/taskchampion-sync-server"; + options = { + mountpoint = "legacy"; + compression = "lz4"; + "com.sun:auto-snapshot:hourly" = toString true; + "com.sun:auto-snapshot:daily" = toString true; + #"com.sun:auto-snapshot:weekly" = toString true; + #"com.sun:auto-snapshot:monthly" = toString true; + }; + }; "vikunja" = { type = "zfs_fs"; mountpoint = "/var/lib/nixos-containers/vikunja"; diff --git a/machines/orbi/service-taskserver.nix b/machines/orbi/service-taskserver.nix index 19c381f..c78dfda 100644 --- a/machines/orbi/service-taskserver.nix +++ b/machines/orbi/service-taskserver.nix @@ -2,26 +2,17 @@ config, lib, pkgs, + zerotierInterface, ... }: { - # todo: backup taskserver via zfs syncoid - services.taskserver = { + networking.firewall.interfaces.wg0.allowedTCPPorts = [ config.services.taskchampion-sync-server.port ]; + networking.firewall.interfaces.wg0.allowedUDPPorts = [ config.services.taskchampion-sync-server.port ]; + + services.taskchampion-sync-server = { enable = true; - fqdn = "taskd.ingolf-wagner.de"; - listenHost = "0.0.0.0"; - requestLimit = 104857600; - trust = "strict"; - dataDir = "/var/lib/taskserver"; - organisations."1337".users = [ - "palo" - "beta" - ]; - ciphers = "SECURE256"; + openFirewall = false; }; - networking.firewall.allowedTCPPorts = [ config.services.taskserver.listenPort ]; - networking.firewall.allowedUDPPorts = [ config.services.taskserver.listenPort ]; - }