Refactor Library

The launcher code was in a position ripe for sphagetti, so this rewrites it in a more robust way.
In addition to cleaner code, this provides the following changes:
- Removal of obsolete Mojang authentication
- The rebasing of some internal state into a Sled database
- Tweaks which make some internal mechanisms more robust (e.g. profiles which fail to load can be removed)
- Additional tooling integration such as direnv
- Distinct public API to avoid messing with too much internal code
- Unified error handling in the form of `theseus::Error` and `theseus::Result`
This commit is contained in:
Danielle
2022-06-27 15:53:25 -07:00
committed by GitHub
parent 179dcdcd04
commit 10610e157f
37 changed files with 2730 additions and 4117 deletions

View File

@@ -14,7 +14,7 @@
};
};
outputs = inputs:
outputs = inputs@{self, ...}:
inputs.utils.lib.eachDefaultSystem (system: let
pkgs = import inputs.nixpkgs { inherit system; };
fenix = inputs.fenix.packages.${system};
@@ -32,13 +32,15 @@
deps = with pkgs; {
global = [
openssl pkg-config
openssl pkg-config gcc
];
gui = [
gtk4 gdk-pixbuf atk webkitgtk
gtk4 gdk-pixbuf atk webkitgtk dbus
];
shell = [
toolchain fenix.default.clippy git
toolchain
(with fenix; combine [toolchain default.clippy rust-analyzer])
git
jdk17 jdk8
];
};
@@ -53,8 +55,22 @@
};
apps = {
theseus-cli = utils.mkApp {
drv = inputs.self.packages.${system}.theseus-cli;
cli = utils.mkApp {
drv = self.packages.${system}.theseus-cli;
};
cli-test = utils.mkApp {
drv = pkgs.writeShellApplication {
name = "theseus-test-cli";
runtimeInputs = [
(self.packages.${system}.theseus-cli.overrideAttrs (old: old // {
release = false;
}))
];
text = ''
DUMMY_ID="$(printf '%0.sa' {1..32})"
theseus_cli profile run -t "" -n "Test" -i "$DUMMY_ID" "$@"
'';
};
};
};
@@ -62,5 +78,5 @@
buildInputs = with deps;
global ++ gui ++ shell;
};
});
})
}