From d2c5b61c8e4765165d6c81cb82255d8c8b1db4c9 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Wed, 13 Nov 2024 12:36:54 -0700 Subject: [PATCH] sliding-sync: remove --- flake.nix | 2 - hosts/h/default.nix | 39 ++------------- modules/default.nix | 1 - modules/sliding-sync.nix | 104 --------------------------------------- pkgs/sliding-sync.nix | 29 ----------- 5 files changed, 3 insertions(+), 172 deletions(-) delete mode 100644 modules/sliding-sync.nix delete mode 100644 pkgs/sliding-sync.nix diff --git a/flake.nix b/flake.nix index 8c1813f..1680685 100644 --- a/flake.nix +++ b/flake.nix @@ -359,8 +359,6 @@ promnesia = upkgs.python3Packages.callPackage ./pkgs/promnesia.nix { inherit upkgs; }; - sliding-sync = - spkgs.callPackage ./pkgs/sliding-sync.nix { inherit spkgs; }; gokrazy = upkgs.callPackage ./pkgs/gokrazy.nix { inherit upkgs; }; gosignify = spkgs.callPackage ./pkgs/gosignify.nix { inherit spkgs; }; gotosocial = diff --git a/hosts/h/default.nix b/hosts/h/default.nix index f91726e..c03f427 100644 --- a/hosts/h/default.nix +++ b/hosts/h/default.nix @@ -8,7 +8,6 @@ with pkgs; let maxUploadSize = "150M"; gqrss = callPackage ../../pkgs/gqrss.nix { inherit isUnstable; }; icbirc = callPackage ../../pkgs/icbirc.nix { inherit isUnstable; }; - slidingSyncPkg = callPackage ../../pkgs/sliding-sync.nix { }; weepushover = python3Packages.callPackage ../../pkgs/weepushover.nix { inherit pkgs; }; pgBackupDir = "/var/backups/postgresql"; @@ -44,13 +43,6 @@ with pkgs; let mkMatrixWellKnown = p: '' return 200 '${builtins.toJSON p}'; ''; - - mkMatrixSliderLoc = { - proxyWebsockets = true; - proxyPass = "http://${config.services.sliding-sync.address}:${ - toString config.services.sliding-sync.port - }"; - }; mkMatrixLoc = { proxyWebsockets = true; proxyPass = "http://${mtxCfg.address}:${toString mtxCfg.port}"; @@ -142,11 +134,6 @@ in mode = "400"; sopsFile = config.xin-secrets.h.secrets.services; }; - sliding_sync_env = { - owner = config.services.sliding-sync.user; - mode = "400"; - sopsFile = config.xin-secrets.h.secrets.services; - }; pr_status_env = { mode = "400"; owner = config.services.ts-reverse-proxy.servers."pr-status-reverse".user; @@ -366,11 +353,6 @@ in }; }; }; - sliding-sync = { - enable = true; - server = "https://tapenet.org"; - package = slidingSyncPkg; - }; pots = { enable = true; envFile = "${config.sops.secrets.pots_env_file.path}"; @@ -835,30 +817,15 @@ in } ''; }; - } - // (if config.services.sliding-sync.enable - then { + "/.well-known/matrix/client".extraConfig = mkMatrixWellKnown matrixClientConfig; "/.well-known/matrix/server".extraConfig = mkMatrixWellKnown matrixServerConfig; - - "/client" = mkMatrixSliderLoc; - "/_matrix/client/unstable/org.matrix.msc3575/sync" = - mkMatrixSliderLoc; - + "/_matrix" = mkMatrixLoc; "/_synapse/client" = mkMatrixLoc; - } - else { - "/.well-known/matrix/client".extraConfig = - mkMatrixWellKnown matrixClientConfig; - "/.well-known/matrix/server".extraConfig = - mkMatrixWellKnown matrixServerConfig; - - "/_matrix" = mkMatrixLoc; - "/_synapse/client" = mkMatrixLoc; - }); + }; }; }; }; diff --git a/modules/default.nix b/modules/default.nix index 3f85fca..1f353cd 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -5,7 +5,6 @@ ./gotosocial.nix ./lock-action.nix ./rtlamr2mqtt.nix - ./sliding-sync.nix ./ssh-fido-agent.nix ./tsvnstat.nix ./veilid-server.nix diff --git a/modules/sliding-sync.nix b/modules/sliding-sync.nix deleted file mode 100644 index 5e035b8..0000000 --- a/modules/sliding-sync.nix +++ /dev/null @@ -1,104 +0,0 @@ -{ lib -, config -, pkgs -, ... -}: -let - cfg = config.services.sliding-sync; -in -{ - options = with lib; { - services.sliding-sync = { - enable = lib.mkEnableOption "Enable sliding-sync"; - - user = mkOption { - type = with types; oneOf [ str int ]; - default = "syncv3"; - description = '' - The user the service will use. - ''; - }; - - group = mkOption { - type = with types; oneOf [ str int ]; - default = "syncv3"; - description = '' - The group the service will use. - ''; - }; - - dataDir = mkOption { - type = types.path; - default = "/var/lib/sliding-sync"; - description = "Path sliding-sync home directory"; - }; - - package = mkOption { - type = types.package; - default = pkgs.sliding-sync; - defaultText = literalExpression "pkgs.sliding-sync"; - description = "The package to use for sliding-sync"; - }; - - port = mkOption { - type = types.int; - default = 8098; - description = "The port sliding-sync should listen on."; - }; - - address = mkOption { - type = types.str; - default = "127.0.0.1"; - description = "The address sliding-sync should listen on."; - }; - - server = mkOption { - type = types.str; - default = ""; - description = "The matrix server to talk to."; - }; - - envFile = mkOption { - type = types.path; - default = "/run/secrets/sliding_sync_env"; - description = '' - Path to a file containing the sliding-sync secret information. - ''; - }; - }; - }; - - config = lib.mkIf cfg.enable { - users.groups.${cfg.group} = { }; - users.users.${cfg.user} = { - description = "sliding-sync service user"; - isSystemUser = true; - home = "${cfg.dataDir}"; - createHome = true; - group = "${cfg.group}"; - }; - - systemd.services.sliding-sync = { - enable = true; - description = "sliding-sync server"; - after = [ "network-online.target" ]; - wants = [ "network-online.target" "matrix-synapse.service" ]; - wantedBy = [ "multi-user.target" ]; - - - environment = { - HOME = "${cfg.dataDir}"; - SYNCV3_BINDADDR = "${cfg.address}:${toString cfg.port}"; - SYNCV3_SERVER = cfg.server; - }; - - serviceConfig = { - User = cfg.user; - Group = cfg.group; - - ExecStart = "${cfg.package}/bin/syncv3"; - EnvironmentFile = cfg.envFile; - }; - }; - }; -} diff --git a/pkgs/sliding-sync.nix b/pkgs/sliding-sync.nix deleted file mode 100644 index 7587220..0000000 --- a/pkgs/sliding-sync.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ lib -, buildGoModule -, fetchFromGitHub -, ... -}: -with lib; -buildGoModule rec { - pname = "sliding-sync"; - version = "0.99.19"; - - src = fetchFromGitHub { - owner = "matrix-org"; - repo = pname; - rev = "v${version}"; - hash = "sha256-w4VL+MioNeJ/R48Ln9tYaqlfg7NvT3mQs0dWOZTHQK4="; - }; - - vendorHash = "sha256-THjvc0TepIBFOTte7t63Dmadf3HMuZ9m0YzQMI5e5Pw="; - - # Note: tests require a postgres install accessible to the current user - doCheck = false; - - meta = { - description = "An implementation of MSC3575"; - homepage = "https://github.com/matrix-org/sliding-sync"; - license = licenses.asl20; - maintainers = with maintainers; [ qbit ]; - }; -}