diff --git a/hosts/wolumonde/modules/conduit.nix b/hosts/wolumonde/modules/conduit.nix index 9542987..e47eba3 100644 --- a/hosts/wolumonde/modules/conduit.nix +++ b/hosts/wolumonde/modules/conduit.nix @@ -1,21 +1,37 @@ -{config, pkgs, ...}: -let - wellKnownFileClient = - pkgs.writeText "client" ( - builtins.toJSON - { "m.homeserver"."base_url" = "https://matrix.gaze.systems"; } - ); - wellKnownFileServer = - pkgs.writeText "server" - (builtins.toJSON { "m.server" = "matrix.gaze.systems:443"; }); -in { + config, + pkgs, + ... +}: let + _wellKnownFileClient = pkgs.writeText "client" ( + builtins.toJSON + {"m.homeserver"."base_url" = "https://matrix.gaze.systems";} + ); + _wellKnownFileServer = + pkgs.writeText "server" + (builtins.toJSON {"m.server" = "matrix.gaze.systems:443";}); + wellKnownFiles = pkgs.runCommand "well-known" {} '' + mkdir -p $out + cp ${_wellKnownFileServer} $out/server + cp ${_wellKnownFileClient} $out/client + ''; +in { services.matrix-conduit = { enable = true; + package = pkgs.matrix-conduit.overrideAttrs (old: rec { + name = "${old.pname}-${version}"; + version = "147f2752"; + src = pkgs.fetchFromGitLab { + owner = "famedly"; + repo = "conduit"; + rev = "147f27521c0d7dbc32d39ec1d8da6cd00008f23c"; + sha256 = "sha256-j469Zh8zyqJNWz7q6gjRu1Khk9y6Xbb52SpxzNjADW8="; + }; + }); settings.global = { server_name = "gaze.systems"; max_request_size = 1000 * 1000 * 20; - allow_registration = true; + allow_registration = false; allow_federation = true; trusted_servers = ["matrix.org" "nixos.dev" "conduit.rs"]; address = "::1"; @@ -26,15 +42,12 @@ in services.nginx.virtualHosts."matrix.gaze.systems" = { enableACME = true; forceSSL = true; - locations."/".proxyPass = - "http://localhost:${toString config.services.matrix-conduit.settings.global.port}"; + locations."/".proxyPass = "http://localhost:${toString config.services.matrix-conduit.settings.global.port}"; }; services.nginx.virtualHosts."gaze.systems" = { - locations."/.well-known/matrix/client".extraConfig = '' - alias ${wellKnownFileClient}; - ''; - locations."/.well-known/matrix/server".extraConfig = '' - alias ${wellKnownFileServer}; + locations."/.well-known/matrix/".extraConfig = '' + add_header content-type application/json; + alias ${wellKnownFiles}/; ''; }; } diff --git a/modules/network/iwd.nix b/modules/network/iwd.nix index b06c1ea..5c43682 100644 --- a/modules/network/iwd.nix +++ b/modules/network/iwd.nix @@ -3,8 +3,8 @@ networking.wireless.iwd = { enable = true; settings = { - Network = { EnableIPv6 = true; }; - Settings = { AutoConnect = true; }; + Network = {EnableIPv6 = true;}; + Settings = {AutoConnect = true;}; }; }; networking.networkmanager.wifi.backend = "iwd"; diff --git a/users/modules/discord/default.nix b/users/modules/discord/default.nix index 2e5e602..98ad4b7 100644 --- a/users/modules/discord/default.nix +++ b/users/modules/discord/default.nix @@ -17,19 +17,19 @@ home.persistence."${config.system.persistDir}${config.home.homeDirectory}".directories = [ ".config/WebCord" ]; - home.packages = - let + home.packages = let pkg = inputs.webcord.packages.${pkgs.system}.webcord; - in - [( - pkgs.runCommand pkg.name {nativeBuildInputs = [pkgs.makeWrapper];} '' - mkdir -p $out - ln -sf ${pkg}/* $out/ - rm $out/bin - mkdir $out/bin - ln -s ${pkg}/bin/webcord $out/bin/webcord - wrapProgram $out/bin/webcord \ - --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [pkgs.pipewire]}" - '' - )]; + in [ + ( + pkgs.runCommand pkg.name {nativeBuildInputs = [pkgs.makeWrapper];} '' + mkdir -p $out + ln -sf ${pkg}/* $out/ + rm $out/bin + mkdir $out/bin + ln -s ${pkg}/bin/webcord $out/bin/webcord + wrapProgram $out/bin/webcord \ + --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [pkgs.pipewire]}" + '' + ) + ]; }