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
|
|
||||||
65
flake.nix
65
flake.nix
|
|
@ -4,41 +4,50 @@
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs:
|
outputs =
|
||||||
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
|
inputs:
|
||||||
systems = ["x86_64-linux" "aarch64-linux"];
|
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
||||||
perSystem = {
|
systems = [
|
||||||
lib,
|
"x86_64-linux"
|
||||||
pkgs,
|
"aarch64-linux"
|
||||||
system,
|
];
|
||||||
...
|
perSystem =
|
||||||
}: {
|
{
|
||||||
_module.args.pkgs = import inputs.nixpkgs {inherit system;};
|
lib,
|
||||||
|
pkgs,
|
||||||
|
system,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
_module.args.pkgs = import inputs.nixpkgs { inherit system; };
|
||||||
|
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
packages = with pkgs; [just dart watchexec];
|
packages = with pkgs; [
|
||||||
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath (with pkgs; [sqlite])}:$LD_LIBRARY_PATH";
|
just
|
||||||
};
|
dart
|
||||||
|
];
|
||||||
|
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath (with pkgs; [ sqlite ])}:$LD_LIBRARY_PATH";
|
||||||
|
};
|
||||||
|
|
||||||
packages.default = pkgs.buildDartApplication {
|
packages.default = pkgs.buildDartApplication {
|
||||||
pname = "nexusbot";
|
pname = "nexusbot";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
||||||
dartConfigHook = "packageRun build_runner build";
|
dartConfigHook = "packageRun build_runner build";
|
||||||
pubspecLock = lib.importJSON ./pubspec.lock.json;
|
pubspecLock = lib.importJSON ./pubspec.lock.json;
|
||||||
|
|
||||||
preInstall = "set -x";
|
preInstall = "set -x";
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "https://git.federated.nexus/Henry-Hiles/nexusbot";
|
homepage = "https://git.federated.nexus/Henry-Hiles/nexusbot";
|
||||||
description = "A bot to automate the sign-up process for Federated Nexus.";
|
description = "A bot to automate the sign-up process for Federated Nexus.";
|
||||||
mainProgram = "nexusbot";
|
mainProgram = "nexusbot";
|
||||||
license = lib.licenses.gpl3Plus;
|
license = lib.licenses.gpl3Plus;
|
||||||
maintainers = [lib.maintainers.quadradical];
|
maintainers = [ lib.maintainers.quadradical ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
flake.nixosModules.default = import ./module.nix inputs.self;
|
flake.nixosModules.default = import ./module.nix inputs.self;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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