Watch
1
0
Fork
You've already forked nexus
0
forked from Nexus/nexus

Compare commits

...
Author SHA1 Message Date
115bec5f05
slightly tweak readme
[skip ci]
2026-07-31 11:55:48 -04:00
fc4aa5a10d
persist member list opened status 2026-07-31 10:20:06 -04:00
f3c31db244
update build requirements 2026-07-29 21:57:03 -04:00
419d75ca83
wrap messages with unknown message types 2026-07-29 19:46:39 -04:00
9831446c66
add a little padding to send errors 2026-07-29 16:18:07 -04:00
d7f49568a7
move attachment sending check to be earlier
fixes sending with keyboard before attachment uploaded
2026-07-29 12:11:57 -04:00
f0f426a647
improve matcher for encrypted media 2026-07-29 12:06:19 -04:00
80fa9673bb
fix pending attachments disappearing when new events are sent 2026-07-29 11:58:12 -04:00
8c25228bd9
comment out macos CI auto running [skip ci] 2026-07-28 20:39:03 -04:00
9bf664624a
clone submodules on macos 2026-07-28 17:43:51 -04:00
e8b90591d5
only include wayland in devshell on macos 2026-07-28 17:16:21 -04:00
b2813a0eb5
use devshell for macos 2026-07-28 17:04:06 -04:00
9298eb815d
use libclang.dylib on macos 2026-07-28 15:57:39 -04:00
06075f75c5
make gomuks nix package build to a .dylib on macos 2026-07-28 15:49:27 -04:00
60968f5f3e
make macos builder build app from nix 2026-07-28 15:29:41 -04:00
afd6168535
fix macos CI name
[skip ci]
2026-07-28 15:15:20 -04:00
2a1cc33ee3
add macos ci
hopefully this works first try :3
2026-07-28 15:13:14 -04:00
13 changed files with 142 additions and 62 deletions

32
.github/workflows/macos.yml vendored Normal file
View file

@ -0,0 +1,32 @@
name: "Build MacOS App"
on:
# TODO: Uncomment this once the MacOS workflow actually works
# push:
# branches: ["main"]
# tags: ["*"]
workflow_dispatch:
jobs:
build-app:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Lix GHA Installer Action
uses: samueldr/lix-gha-installer-action@v2026-02-22
with:
extra_nix_config: experimental-features = nix-command flakes flake-self-attrs
- name: Build app
run: nix develop --command bash -c "flutter pub get && dart scripts/generate.dart && flutter pub run build_runner build && flutter build macos --release"
- name: Upload installer artifact
uses: actions/upload-artifact@v6
with:
name: App
path: build/macos/Build/Products/Release/Nexus.app

View file

@ -127,15 +127,16 @@ If you want to try out Nexus, grab one of the following artifacts from CI:
#### Linux #### Linux
- With Nix: Either use direnv and `direnv allow`, or `nix flake develop` - With Nix: Either use direnv and `direnv allow`, or `nix flake develop`
- Without Nix: Install Flutter, Go, Git, Libclang, and Glibc. Do not use any Snap packages, they cause various compilation issues. - Without Nix: Install Flutter, Go, Git, Libclang, Libass, MPV, and Glibc. Do not use any Snap packages, they cause various compilation issues.
#### Windows #### Windows
You will need: You will need:
- Flutter - Flutter
- Android SDK + NDK
- Git - Git
- Libass
- MPV
- Go - Go
- Visual Studio 2022 (Desktop development with C++) - Visual Studio 2022 (Desktop development with C++)
- [MSYS2/MinGW-w64 GCC](https://www.msys2.org/) (for CGO) - [MSYS2/MinGW-w64 GCC](https://www.msys2.org/) (for CGO)
@ -202,7 +203,7 @@ Development instructions can be found in [DEVELOPMENT.md](./DEVELOPMENT.md).
## Community ## Community
Join the [Nexus Client Matrix Room](https://matrix.to/#/#nexus:federated.nexus) for questions or help with developing or using Nexus Client. Join the [Nexus Client Matrix room](https://matrix.to/#/#nexus:federated.nexus) for questions or help with developing or using Nexus Client.
# Credits # Credits

View file

@ -17,18 +17,16 @@ class AttachmentController extends Notifier<(String, MessageContent?)?> {
final filename = basename(file.path); final filename = basename(file.path);
state = (filename, null); state = (filename, null);
final room = ref.watch( final isEncrypted = ref.read(
RoomsController.provider.select((value) => value[roomId]), RoomsController.provider.select(
(value) =>
value[roomId]?.state[EventType.encryption.type]?.isNotEmpty == true,
),
); );
final content = await ref final content = await ref
.watch(ClientController.provider.notifier) .watch(ClientController.provider.notifier)
.uploadMedia( .uploadMedia(.new(path: file.path, encrypt: isEncrypted));
.new(
path: file.path,
encrypt: room?.state[EventType.encryption.type]?.isNotEmpty == true,
),
);
state = (filename, content); state = (filename, content);
} }

View file

@ -0,0 +1,22 @@
import "package:flutter_riverpod/flutter_riverpod.dart";
import "package:nexus/controllers/shared_prefs.dart";
class MemberListOpenedController extends Notifier<bool> {
static const String key = "memberListOpened";
@override
bool build() =>
ref.watch(SharedPrefsController.provider).requireValue.getBool(key) ??
true;
Future<void> set(bool value) async {
final prefs = ref.watch(SharedPrefsController.provider).requireValue;
state = value;
prefs.setBool(key, value);
}
static final provider = NotifierProvider<MemberListOpenedController, bool>(
MemberListOpenedController.new,
);
}

View file

@ -125,11 +125,9 @@ class RoomChatController extends AsyncNotifier<IList<Event>?> {
if (relationType == .edit) { if (relationType == .edit) {
baseContent = relation?.content; baseContent = relation?.content;
} else { } else {
final attachment = ref.watch(AttachmentController.provider(roomId)); final provider = AttachmentController.provider(roomId);
if (attachment != null && attachment.$2 == null) return; baseContent = ref.watch(provider)?.$2;
ref.invalidate(provider);
baseContent = attachment?.$2;
ref.invalidate(AttachmentController.provider(roomId));
} }
var taggedMessage = text; var taggedMessage = text;

View file

@ -59,7 +59,10 @@ class Composer extends HookConsumerWidget {
final attachment = ref.watch(AttachmentController.provider(roomId)); final attachment = ref.watch(AttachmentController.provider(roomId));
void send() { void send() {
if (controller.value.text.isEmpty && attachment == null) return; if (controller.value.text.isEmpty && attachment == null ||
attachment != null && attachment.$2 == null) {
return;
}
onSend( onSend(
controller.value.formattedText, controller.value.formattedText,
shouldMention: shouldMention.value, shouldMention: shouldMention.value,

View file

@ -216,12 +216,15 @@ class EventRenderer extends HookConsumerWidget {
if (event.content is! MessageContent) ReactionRow(event), if (event.content is! MessageContent) ReactionRow(event),
if (event.sendError != null && event.sendError != "not sent") if (event.sendError != null && event.sendError != "not sent")
Text( Padding(
padding: .only(bottom: 4),
child: Text(
event.sendError!, event.sendError!,
style: theme.textTheme.labelSmall?.copyWith( style: theme.textTheme.labelSmall?.copyWith(
color: theme.colorScheme.error, color: theme.colorScheme.error,
), ),
), ),
),
].map((child) => Padding(padding: .only(left: 4), child: child)), ].map((child) => Padding(padding: .only(left: 4), child: child)),
], ],
] else if (textOnly) ] else if (textOnly)

View file

@ -286,9 +286,8 @@ class MessageRenderer extends ConsumerWidget {
"This message is redacted", "This message is redacted",
style: errorStyle, style: errorStyle,
) )
: Row( : Wrap(
spacing: 8, spacing: 8,
mainAxisSize: .min,
children: [ children: [
Text( Text(
"Unknown message type:", "Unknown message type:",

View file

@ -7,6 +7,7 @@ import "package:measure_size/measure_size.dart";
import "package:nexus/controllers/account_data.dart"; import "package:nexus/controllers/account_data.dart";
import "package:nexus/controllers/client.dart"; import "package:nexus/controllers/client.dart";
import "package:nexus/controllers/client_state.dart"; import "package:nexus/controllers/client_state.dart";
import "package:nexus/controllers/member_list_opened.dart";
import "package:nexus/controllers/pinned_ids.dart"; import "package:nexus/controllers/pinned_ids.dart";
import "package:nexus/controllers/power_level.dart"; import "package:nexus/controllers/power_level.dart";
import "package:nexus/controllers/rooms.dart"; import "package:nexus/controllers/rooms.dart";
@ -46,9 +47,8 @@ class RoomChat extends HookConsumerWidget {
final composerSize = useState<double>(64); final composerSize = useState<double>(64);
final memberListOpened = useState<bool>(showMembersByDefault);
final userId = ref.watch(ClientStateController.provider)?.userId; final userId = ref.watch(ClientStateController.provider)?.userId;
final memberListOpened = ref.watch(MemberListOpenedController.provider);
final theme = Theme.of(context); final theme = Theme.of(context);
final nothing = Center( final nothing = Center(
@ -448,7 +448,9 @@ class RoomChat extends HookConsumerWidget {
isDesktop: isDesktop, isDesktop: isDesktop,
onOpenDrawer: Scaffold.of(context).openDrawer, onOpenDrawer: Scaffold.of(context).openDrawer,
onOpenMemberList: (thisContext) { onOpenMemberList: (thisContext) {
memberListOpened.value = !memberListOpened.value; ref
.watch(MemberListOpenedController.provider.notifier)
.set(!memberListOpened);
Scaffold.of(thisContext).openEndDrawer(); Scaffold.of(thisContext).openEndDrawer();
}, },
onOpenPinnedMessagesList: () { onOpenPinnedMessagesList: () {
@ -553,7 +555,7 @@ class RoomChat extends HookConsumerWidget {
), ),
), ),
if (memberListOpened.value == true && showMembersByDefault) if (memberListOpened == true && showMembersByDefault)
MemberList(roomId), MemberList(roomId),
], ],
), ),

View file

@ -18,12 +18,13 @@ let
}; };
in in
pkgs.mkShell { pkgs.mkShell {
packages = with pkgs; [ packages =
with pkgs;
[
go go
git git
jdk17 jdk17
libGL libGL
wayland
(flutter.override { (flutter.override {
extraPkgConfigPackages = [ extraPkgConfigPackages = [
mpv-unwrapped mpv-unwrapped
@ -31,12 +32,11 @@ pkgs.mkShell {
]; ];
}) })
android.platform-tools android.platform-tools
]; ]
++ lib.optional pkgs.stdenv.isLinux wayland;
env = rec { env = rec {
LIBCLANG_PATH = lib.makeLibraryPath [ pkgs.libclang ]; LIBCLANG_PATH = lib.makeLibraryPath [ pkgs.libclang ];
LD_LIBRARY_PATH = "./build/native_assets/linux:${lib.makeLibraryPath [ pkgs.zlib ]}";
CPATH = lib.makeSearchPath "include" [ pkgs.glibc.dev ];
ANDROID_HOME = "${android.androidsdk}/libexec/android-sdk"; ANDROID_HOME = "${android.androidsdk}/libexec/android-sdk";
ANDROID_SDK_ROOT = ANDROID_HOME; ANDROID_SDK_ROOT = ANDROID_HOME;
@ -44,5 +44,9 @@ pkgs.mkShell {
TOOLS = "${ANDROID_HOME}/build-tools/${"36.0.0"}"; TOOLS = "${ANDROID_HOME}/build-tools/${"36.0.0"}";
GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${TOOLS}/aapt2"; GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${TOOLS}/aapt2";
}
// lib.optionalAttrs pkgs.stdenv.isLinux {
CPATH = lib.makeSearchPath "include" [ pkgs.glibc.dev ];
LD_LIBRARY_PATH = "./build/native_assets/linux:${lib.makeLibraryPath [ pkgs.zlib ]}";
}; };
} }

View file

@ -44,7 +44,7 @@ flutter.buildFlutterApplication {
meta = { meta = {
description = "A simple and user-friendly Matrix client"; description = "A simple and user-friendly Matrix client";
mainProgram = "nexus"; mainProgram = "nexus";
platforms = lib.platforms.linux; platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ quadradical ]; maintainers = with lib.maintainers; [ quadradical ];
}; };
} }

View file

@ -1,9 +1,15 @@
{ {
src, src,
stdenv,
buildGoModule, buildGoModule,
}: }:
buildGoModule (finalAttrs: { buildGoModule (
finalAttrs:
let
filename = "libgomuks${stdenv.hostPlatform.extensions.sharedLibrary}";
in
{
pname = "gomuks-ffi"; pname = "gomuks-ffi";
version = "submodule"; version = "submodule";
@ -16,7 +22,7 @@ buildGoModule (finalAttrs: {
buildPhase = '' buildPhase = ''
runHook preBuild runHook preBuild
go build -buildmode=c-shared -o libgomuks.so -tags goolm,noheic,sqlite_fts5 ./pkg/ffi go build -buildmode=c-shared -o ${filename} -tags goolm,noheic,sqlite_fts5 ./pkg/ffi
runHook postBuild runHook postBuild
''; '';
@ -24,8 +30,9 @@ buildGoModule (finalAttrs: {
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
install -Dm0644 libgomuks.so -t $out/lib install -Dm0644 ${filename} -t $out/lib
runHook postInstall runHook postInstall
''; '';
}) }
)

View file

@ -24,7 +24,18 @@ void main(List<String> args) async {
).generate( ).generate(
libclangDylib: libclangPath == null libclangDylib: libclangPath == null
? null ? null
: Uri.file(join(libclangPath, "libclang.so")), : Uri.file(
join(
libclangPath,
"libclang.${(Platform.isLinux || Platform.isAndroid)
? "so"
: Platform.isMacOS
? "dylib"
: Platform.isWindows
? "dll"
: throw UnsupportedError("Unsupported Platform")}",
),
),
); );
print("Done!"); print("Done!");
} }