diff --git a/.gitignore b/.gitignore index d6c83cfb1..cb23ef109 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,30 @@ build.sh # the following line was added with the "git ignore" tool by itsrye.dev, version 0.1.0 .lh + +# the following line was added with the "git ignore" tool by itsrye.dev, version 0.1.0 +.lh + +# Tauri +/build +/target/ +/gen/schemas +dist-js + +# Gradle / Android build artifacts +**/android/build/ +**/android/.tauri/ +**/android/.gradle/ +**/.gradle/ + +# Rust build artifacts +src-tauri/target/ +# Tauri Android build outputs +src-tauri/gen/android/app/build/ + + +# Rust build artifacts in subcrates +crates/**/target/ + +# Worktrees +.worktrees \ No newline at end of file diff --git a/.prettierignore b/.prettierignore index af963ef93..93534783c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,4 +5,7 @@ pnpm-lock.yaml LICENSE README.md CHANGELOG.md -./changeset \ No newline at end of file +./changeset +src/app/generated +crates/ +src-tauri/ \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 29e56e92a..67cc799e6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,8 @@ }, "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[rust]": { + "editor.defaultFormatter": "rust-lang.rust-analyzer" } } diff --git a/config.json b/config.json index 1bdffb675..73db21db9 100644 --- a/config.json +++ b/config.json @@ -10,7 +10,8 @@ "pushNotificationDetails": { "pushNotifyUrl": "https://sygnal.sable.moe/_matrix/push/v1/notify", "vapidPublicKey": "BCnS4SbHjeOaqVFW4wjt5xDt_pYIL62qMzKePfYF9fl9PQU14RieIaObh7nLR_9dQf4sykZa-CTrcjkgMIE1mcg", - "webPushAppID": "moe.sable.app.sygnal" + "webPushAppID": "moe.sable.app.sygnal", + "unifiedPushAppID": "moe.sable.up" }, "slidingSync": { diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..a70fe3c7a --- /dev/null +++ b/flake.lock @@ -0,0 +1,187 @@ +{ + "nodes": { + "android-nixpkgs": { + "inputs": { + "devshell": "devshell", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1773434018, + "narHash": "sha256-g/OmqUpsyUg3lw6QNkJudtsE2XVydkCKq724KIrr4no=", + "owner": "tadfisher", + "repo": "android-nixpkgs", + "rev": "b12e333a75f25fde82adad28acf47f57eb1b3dc4", + "type": "github" + }, + "original": { + "owner": "tadfisher", + "repo": "android-nixpkgs", + "type": "github" + } + }, + "devshell": { + "inputs": { + "nixpkgs": [ + "android-nixpkgs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1768818222, + "narHash": "sha256-460jc0+CZfyaO8+w8JNtlClB2n4ui1RbHfPTLkpwhU8=", + "owner": "numtide", + "repo": "devshell", + "rev": "255a2b1725a20d060f566e4755dbf571bbbb5f76", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1773282481, + "narHash": "sha256-b/GV2ysM8mKHhinse2wz+uP37epUrSE+sAKXy/xvBY4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fe416aaedd397cacb33a610b33d60ff2b431b127", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1773282481, + "narHash": "sha256-b/GV2ysM8mKHhinse2wz+uP37epUrSE+sAKXy/xvBY4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fe416aaedd397cacb33a610b33d60ff2b431b127", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1744536153, + "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "android-nixpkgs": "android-nixpkgs", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1773371126, + "narHash": "sha256-SGnZQO8hnynR90Lo/1MVrTScsOPx9i26XjqSqoFOZ4E=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "475826b105eb52f39bd3281f60c052299e64d085", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..84c7fd536 --- /dev/null +++ b/flake.nix @@ -0,0 +1,136 @@ +# https://github.com/PleahMaCaka/svelte-tauri-template/blob/a598c33a34489b07680e14bb0d82ac01b0a9a4be/flake.nix +{ + description = "sable dev environment"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + rust-overlay.url = "github:oxalica/rust-overlay"; + android-nixpkgs.url = "github:tadfisher/android-nixpkgs"; + }; + + nixConfig = { + bash-prompt = "\\[\\e[1;35m\\]sable\\[\\e[0m\\]"; # bold magenta + bash-prompt-suffix = " \\[\\e[0;36m\\]>\\[\\e[0m\\] "; # cyan > + }; + + outputs = + { + nixpkgs, + flake-utils, + rust-overlay, + android-nixpkgs, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ rust-overlay.overlays.default ]; + config = { + android_sdk.accept_license = true; + allowUnfree = true; + }; + }; + + rust = pkgs.rust-bin.stable.latest.default.override { + targets = [ + "aarch64-linux-android" + "armv7-linux-androideabi" + "i686-linux-android" + "x86_64-linux-android" + ]; + }; + + androidSdk = android-nixpkgs.sdk.${system} ( + sdkPkgs: with sdkPkgs; [ + build-tools-34-0-0 + platforms-android-34 + ndk-26-1-10909125 + cmdline-tools-latest + platform-tools + emulator + ] + ); + + baseShell = { + nativeBuildInputs = with pkgs; [ + pkg-config + gobject-introspection + cargo + cargo-tauri + nodejs + xdg-utils + desktop-file-utils + ]; + + buildInputs = with pkgs; [ + at-spi2-atk + atkmm + cairo + gdk-pixbuf + glib + glib-networking + gtk3 + gsettings-desktop-schemas + harfbuzz + librsvg + libsoup_3 + pango + webkitgtk_4_1 + openssl + libayatana-appindicator + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + gst_all_1.gst-plugins-bad + gst_all_1.gst-plugins-ugly + gst_all_1.gst-libav + ]; + + packages = with pkgs; [ + coreutils + nix + pnpm + rust + ]; + + shellHook = '' + export XDG_DATA_DIRS="$GSETTINGS_SCHEMAS_PATH:$XDG_DATA_DIRS" + export GIO_EXTRA_MODULES="${pkgs.glib-networking}/lib/gio/modules" + export GST_PLUGIN_SYSTEM_PATH="${pkgs.gst_all_1.gst-plugins-base}/lib/gstreamer-1.0:${pkgs.gst_all_1.gst-plugins-good}/lib/gstreamer-1.0:${pkgs.gst_all_1.gst-plugins-bad}/lib/gstreamer-1.0" + alias tauri="pnpm exec tauri" + echo "Done! Now make sable stable :3"; + ''; + }; + in + { + devShells = { + default = pkgs.mkShell { + name = "sable dev environment"; + inherit (baseShell) nativeBuildInputs buildInputs packages shellHook; + + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ + pkgs.libayatana-appindicator + ]; + }; + + android = pkgs.mkShell { + name = "sable dev environment (android)"; + inherit (baseShell) nativeBuildInputs buildInputs; # <-- shellHook removed here + + packages = baseShell.packages ++ (with pkgs; [ + jdk + androidSdk + ]); + + shellHook = baseShell.shellHook + '' + export NDK_HOME=${androidSdk}/share/android-sdk/ndk/26.1.10909125 + echo "Android SDK ready!"; + ''; + }; + }; + } + ); +} diff --git a/index.html b/index.html index c22ea4274..ef16fff44 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,10 @@
- +