diff --git a/hosts/wynne/services/apps/dendrite/default.nix b/hosts/wynne/services/apps/dendrite/default.nix index 1a1cb74..5bc27f9 100644 --- a/hosts/wynne/services/apps/dendrite/default.nix +++ b/hosts/wynne/services/apps/dendrite/default.nix @@ -50,27 +50,40 @@ in environmentFile = config.sops.secrets."matrix/syncv3_secret".path; }; }; - systemd.services.dendrite = { - description = "Dendrite Matrix homeserver"; - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; - unitConfig.RequiresMountsFor = [ "/mnt/data" ]; - serviceConfig = { - Type = "simple"; - User = "dendrite"; - Group = "dendrite"; - StateDirectory = "dendrite"; - WorkingDirectory = "/mnt/data/dendrite"; - RuntimeDirectory = "dendrite"; - RuntimeDirectoryMode = "0700"; - LimitNOFILE = 65535; - ExecStart = '' - ${pkgs.dendrite}/bin/dendrite -http-bind-address 127.0.0.1:8008 -config ${./config.yaml} - ''; - ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; - Restart = "on-failure"; + systemd.services.dendrite = + let + dendrite_package = pkgs.dendrite.overrideAttrs rec { + version = "0.13.8"; + src = pkgs.fetchFromGitHub { + owner = "matrix-org"; + repo = "dendrite"; + rev = "v${version}"; + hash = "sha256-zUpZdG2cdZ95L70qLG2HaUlD+G66XTi4f1V4+ZZAh30="; + }; + vendorHash = "sha256-rGOB1ikY3BgChvD1YZUF66g8P6gE29b/k9kxvHR0+WQ="; + }; + in + { + description = "Dendrite Matrix homeserver"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + unitConfig.RequiresMountsFor = [ "/mnt/data" ]; + serviceConfig = { + Type = "simple"; + User = "dendrite"; + Group = "dendrite"; + StateDirectory = "dendrite"; + WorkingDirectory = "/mnt/data/dendrite"; + RuntimeDirectory = "dendrite"; + RuntimeDirectoryMode = "0700"; + LimitNOFILE = 65535; + ExecStart = '' + ${dendrite_package}/bin/dendrite -http-bind-address 127.0.0.1:8008 -config ${./config.yaml} + ''; + ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; + Restart = "on-failure"; + }; }; - }; users.users.dendrite = { name = "dendrite"; description = "Dendrite server user";