Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
1cfea5a819 |
|||
|
b3023d8147 |
8 changed files with 143 additions and 67 deletions
57
flake.nix
57
flake.nix
|
|
@ -16,67 +16,12 @@
|
|||
...
|
||||
}@inputs:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
imports = [ ./linux/nix ];
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"aarch64-darwin"
|
||||
"x86_64-darwin"
|
||||
];
|
||||
|
||||
perSystem =
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
system,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
_module.args.pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = {
|
||||
android_sdk.accept_license = true;
|
||||
allowUnfree = true;
|
||||
};
|
||||
};
|
||||
|
||||
packages =
|
||||
let
|
||||
default = pkgs.callPackage ./linux/nix/pkg {
|
||||
src = self;
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit default;
|
||||
|
||||
flatpak = inputs.nix2flatpak.lib.${system}.mkFlatpak {
|
||||
appName = "Nexus";
|
||||
developer = "QuadRadical";
|
||||
appId = "nexus.federated.nexus";
|
||||
package = default;
|
||||
runtime = "org.gnome.Platform/49";
|
||||
permissions = {
|
||||
share = [ "network" ];
|
||||
sockets = [
|
||||
"pulseaudio"
|
||||
"fallback-x11"
|
||||
"wayland"
|
||||
];
|
||||
|
||||
talk-names = [
|
||||
"org.unifiedpush.Distributor.*"
|
||||
"org.freedesktop.Notifications"
|
||||
];
|
||||
devices = [ "dri" ];
|
||||
};
|
||||
};
|
||||
|
||||
gomuks = pkgs.callPackage ./linux/nix/pkg/gomuks.nix {
|
||||
src = self;
|
||||
};
|
||||
};
|
||||
|
||||
devShells.default = pkgs.callPackage ./linux/nix/devshell.nix { };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ class UnifiedPushController extends AsyncNotifier<bool> {
|
|||
dbusName: "nexus.federated.nexus.UnifiedPush",
|
||||
storage: UnifiedPushStorageSharedPreferences(),
|
||||
background: isInBackground,
|
||||
shouldWriteService: true,
|
||||
),
|
||||
onNewEndpoint: (endpoint, instance) async {
|
||||
final pushKey = endpoint.pubKeySet!.pubKey;
|
||||
|
|
|
|||
3
linux/nexus.federated.nexus.UnifiedPush.service
Normal file
3
linux/nexus.federated.nexus.UnifiedPush.service
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[D-BUS Service]
|
||||
Name=nexus.federated.nexus.UnifiedPush
|
||||
Exec=/usr/bin/env FLUTTER_HEADLESS=1 nexus
|
||||
59
linux/nix/default.nix
Normal file
59
linux/nix/default.nix
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
{ self, inputs, ... }: {
|
||||
|
||||
perSystem =
|
||||
{
|
||||
pkgs,
|
||||
system,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
_module.args.pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
config = {
|
||||
android_sdk.accept_license = true;
|
||||
allowUnfree = true;
|
||||
};
|
||||
};
|
||||
|
||||
packages =
|
||||
let
|
||||
default = pkgs.callPackage ./pkg {
|
||||
src = self;
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit default;
|
||||
|
||||
flatpak = inputs.nix2flatpak.lib.${system}.mkFlatpak {
|
||||
appName = "Nexus";
|
||||
developer = "QuadRadical";
|
||||
appId = "nexus.federated.nexus";
|
||||
package = default;
|
||||
runtime = "org.gnome.Platform/49";
|
||||
permissions = {
|
||||
share = [ "network" ];
|
||||
sockets = [
|
||||
"pulseaudio"
|
||||
"fallback-x11"
|
||||
"wayland"
|
||||
];
|
||||
|
||||
talk-names = [
|
||||
"org.unifiedpush.Distributor.*"
|
||||
"org.freedesktop.Notifications"
|
||||
];
|
||||
devices = [ "dri" ];
|
||||
};
|
||||
};
|
||||
|
||||
gomuks = pkgs.callPackage ./pkg/gomuks.nix {
|
||||
src = self;
|
||||
};
|
||||
};
|
||||
|
||||
devShells.default = pkgs.callPackage ./devshell.nix { };
|
||||
};
|
||||
|
||||
flake.nixosModules.default = import ./module.nix self;
|
||||
}
|
||||
55
linux/nix/module.nix
Normal file
55
linux/nix/module.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
self:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
mkIf
|
||||
mkMerge
|
||||
mkOption
|
||||
mkEnableOption
|
||||
mkPackageOption
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.programs.nexus;
|
||||
in
|
||||
{
|
||||
options.programs.nexus = {
|
||||
enable = mkEnableOption "Nexus, a simple and user-friendly Matrix client";
|
||||
package = mkPackageOption self.packages.${pkgs.stdenv.hostPlatform.system} "nexus" { };
|
||||
|
||||
enableNotifications = mkOption {
|
||||
description = ''
|
||||
Whether to enable push notifications support via UnifiedPush, installing
|
||||
{manpage}`kunifiedpush` and registering its systemd and D-Bus units.
|
||||
'';
|
||||
type = types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
}
|
||||
(mkIf cfg.enableNotifications {
|
||||
environment.systemPackages = [
|
||||
pkgs.kdePackages.kunifiedpush
|
||||
];
|
||||
|
||||
systemd.packages = [
|
||||
pkgs.kdePackages.kunifiedpush
|
||||
];
|
||||
|
||||
services.dbus.packages = [
|
||||
cfg.package
|
||||
];
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
@ -37,6 +37,7 @@ flutter.buildFlutterApplication {
|
|||
postInstall = ''
|
||||
install -D assets/bundled/icon.svg $out/share/icons/hicolor/scalable/apps/nexus.svg
|
||||
install -Dm755 linux/nexus.federated.nexus.desktop -t $out/share/applications
|
||||
install -Dm644 linux/*.service -t $out/share/dbus-1/services
|
||||
wrapProgram $out/bin/nexus \
|
||||
--suffix LD_LIBRARY_PATH : $out/app/nexus/lib
|
||||
'';
|
||||
|
|
|
|||
24
pubspec.lock
24
pubspec.lock
|
|
@ -1501,20 +1501,22 @@ packages:
|
|||
source: hosted
|
||||
version: "3.5.0"
|
||||
unifiedpush_linux:
|
||||
dependency: transitive
|
||||
dependency: "direct overridden"
|
||||
description:
|
||||
name: unifiedpush_linux
|
||||
sha256: c062d5eedd1cec70bcd33270cc4e01ae0ff6501f33d471167c06b34a968adfeb
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
path: unifiedpush_linux
|
||||
ref: "quad/feat/should-write-service-option"
|
||||
resolved-ref: "7589b07ef4280820e4adea165d3d86b219f6022c"
|
||||
url: "https://codeberg.org/Henry-Hiles/flutter-connector"
|
||||
source: git
|
||||
version: "1.0.1"
|
||||
unifiedpush_platform_interface:
|
||||
dependency: transitive
|
||||
dependency: "direct overridden"
|
||||
description:
|
||||
name: unifiedpush_platform_interface
|
||||
sha256: "83372bc8d794b8b12ef6993b518d7be907dcfc2191bdf6de0ece5c4445d89880"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
path: unifiedpush_platform_interface
|
||||
ref: "quad/feat/should-write-service-option"
|
||||
resolved-ref: "7589b07ef4280820e4adea165d3d86b219f6022c"
|
||||
url: "https://codeberg.org/Henry-Hiles/flutter-connector"
|
||||
source: git
|
||||
version: "4.0.0"
|
||||
unifiedpush_storage_interface:
|
||||
dependency: transitive
|
||||
|
|
|
|||
10
pubspec.yaml
10
pubspec.yaml
|
|
@ -20,6 +20,16 @@ environment:
|
|||
|
||||
dependency_overrides:
|
||||
dynamic_color: 2.1.0
|
||||
unifiedpush_linux:
|
||||
git:
|
||||
url: https://codeberg.org/Henry-Hiles/flutter-connector
|
||||
ref: quad/feat/should-write-service-option
|
||||
path: unifiedpush_linux
|
||||
unifiedpush_platform_interface:
|
||||
git:
|
||||
url: https://codeberg.org/Henry-Hiles/flutter-connector
|
||||
ref: quad/feat/should-write-service-option
|
||||
path: unifiedpush_platform_interface
|
||||
path_provider_android: 2.2.23 # Pinned to avoid JNI
|
||||
linkify:
|
||||
git:
|
||||
|
|
|
|||
Loading…
Reference in a new issue