diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index effe43c..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.0 - -- Initial version. diff --git a/JUSTFILE b/JUSTFILE deleted file mode 100644 index dff0cc6..0000000 --- a/JUSTFILE +++ /dev/null @@ -1,8 +0,0 @@ -test: - curl --unix-socket ./socket http:/./ -X POST -d '{"email": "foo@henryhiles.com", "username": "name"}' - -watch: - dart run build_runner watch - -build: - dart run build_runner build \ No newline at end of file diff --git a/flake.nix b/flake.nix index 715b303..002da66 100644 --- a/flake.nix +++ b/flake.nix @@ -4,41 +4,50 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; }; - outputs = inputs: - inputs.flake-parts.lib.mkFlake {inherit inputs;} { - systems = ["x86_64-linux" "aarch64-linux"]; - perSystem = { - lib, - pkgs, - system, - ... - }: { - _module.args.pkgs = import inputs.nixpkgs {inherit system;}; + outputs = + inputs: + inputs.flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ + "x86_64-linux" + "aarch64-linux" + ]; + perSystem = + { + lib, + pkgs, + system, + ... + }: + { + _module.args.pkgs = import inputs.nixpkgs { inherit system; }; - devShells.default = pkgs.mkShell { - packages = with pkgs; [just dart watchexec]; - LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath (with pkgs; [sqlite])}:$LD_LIBRARY_PATH"; - }; + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + just + dart + ]; + LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath (with pkgs; [ sqlite ])}:$LD_LIBRARY_PATH"; + }; - packages.default = pkgs.buildDartApplication { - pname = "nexusbot"; - version = "1.0.0"; - src = ./.; + packages.default = pkgs.buildDartApplication { + pname = "nexusbot"; + version = "1.0.0"; + src = ./.; - dartConfigHook = "packageRun build_runner build"; - pubspecLock = lib.importJSON ./pubspec.lock.json; + dartConfigHook = "packageRun build_runner build"; + pubspecLock = lib.importJSON ./pubspec.lock.json; - preInstall = "set -x"; + preInstall = "set -x"; - meta = { - homepage = "https://git.federated.nexus/Henry-Hiles/nexusbot"; - description = "A bot to automate the sign-up process for Federated Nexus."; - mainProgram = "nexusbot"; - license = lib.licenses.gpl3Plus; - maintainers = [lib.maintainers.quadradical]; + meta = { + homepage = "https://git.federated.nexus/Henry-Hiles/nexusbot"; + description = "A bot to automate the sign-up process for Federated Nexus."; + mainProgram = "nexusbot"; + license = lib.licenses.gpl3Plus; + maintainers = [ lib.maintainers.quadradical ]; + }; }; }; - }; flake.nixosModules.default = import ./module.nix inputs.self; }; } diff --git a/lib/controllers/client_controller.dart b/lib/controllers/client_controller.dart deleted file mode 100644 index 066c618..0000000 --- a/lib/controllers/client_controller.dart +++ /dev/null @@ -1,33 +0,0 @@ -import "dart:io"; - -import "package:matrix/matrix.dart"; -import "package:nexusbot/controllers/settings_controller.dart"; -import "package:riverpod/riverpod.dart"; -import "package:sqflite_common_ffi/sqflite_ffi.dart"; - -class ClientController extends AsyncNotifier { - @override - Future build() async { - final settings = ref.watch(SettingsController.provider)!; - final client = Client( - "nexusbot", - database: await MatrixSdkDatabase.init( - "NexusBot", - database: await databaseFactoryFfi.openDatabase(inMemoryDatabasePath), - ), - ); - - await client.checkHomeserver(settings.homeserver); - await client.login( - LoginType.mLoginPassword, - identifier: AuthenticationUserIdentifier(user: settings.name), - password: (await File(settings.botPasswordFile).readAsString()).trim(), - ); - - return client; - } - - static final provider = AsyncNotifierProvider( - ClientController.new, - ); -} diff --git a/lib/controllers/last_synced_controller.dart b/lib/controllers/last_synced_controller.dart deleted file mode 100644 index a36d33d..0000000 --- a/lib/controllers/last_synced_controller.dart +++ /dev/null @@ -1,12 +0,0 @@ -import "package:riverpod/riverpod.dart"; - -class LastSyncedController extends Notifier { - @override - String? build() => null; - - void set(String value) => state = value; - - static final provider = NotifierProvider( - LastSyncedController.new, - ); -}