remove dead code
This commit is contained in:
parent
d2b531f953
commit
105aed226d
5 changed files with 37 additions and 84 deletions
|
|
@ -1,3 +0,0 @@
|
|||
## 1.0.0
|
||||
|
||||
- Initial version.
|
||||
8
JUSTFILE
8
JUSTFILE
|
|
@ -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
|
||||
27
flake.nix
27
flake.nix
|
|
@ -4,20 +4,29 @@
|
|||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs = inputs:
|
||||
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
systems = ["x86_64-linux" "aarch64-linux"];
|
||||
perSystem = {
|
||||
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;};
|
||||
}:
|
||||
{
|
||||
_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";
|
||||
packages = with pkgs; [
|
||||
just
|
||||
dart
|
||||
];
|
||||
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath (with pkgs; [ sqlite ])}:$LD_LIBRARY_PATH";
|
||||
};
|
||||
|
||||
packages.default = pkgs.buildDartApplication {
|
||||
|
|
@ -35,7 +44,7 @@
|
|||
description = "A bot to automate the sign-up process for Federated Nexus.";
|
||||
mainProgram = "nexusbot";
|
||||
license = lib.licenses.gpl3Plus;
|
||||
maintainers = [lib.maintainers.quadradical];
|
||||
maintainers = [ lib.maintainers.quadradical ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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<Client> {
|
||||
@override
|
||||
Future<Client> 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, Client>(
|
||||
ClientController.new,
|
||||
);
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
import "package:riverpod/riverpod.dart";
|
||||
|
||||
class LastSyncedController extends Notifier<String?> {
|
||||
@override
|
||||
String? build() => null;
|
||||
|
||||
void set(String value) => state = value;
|
||||
|
||||
static final provider = NotifierProvider<LastSyncedController, String?>(
|
||||
LastSyncedController.new,
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue