diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e7b1e723..2609608d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,8 +38,10 @@ To make changes locally, follow these steps: 1. Clone the repository: `git clone https://github.com/Polyfrost/OneLauncher` 2. Navigate to the project directory: `cd OneLauncher` 3. Configure your system environment for OneLauncher development: - 1. For Linux users, run: `./packages/scripts/setup.sh` - > The [Unix script] will check if Rust and pnpm are installed then proceed to install Clang, NASM, LLVM, libvips, [Tauri essentials] and any other required dependencies for OneLauncher to build. + 1. Linux: + 1. NixOS: Please use `nix develop` + 2. For Other Linux users, run: `./packages/scripts/setup.sh` + > The [Unix script] will check if Rust and pnpm are installed then proceed to install Clang, NASM, LLVM, libvips, [Tauri essentials] and any other required dependencies for OneLauncher to build. 2. For macOS users, run: `./packages/scripts/setup.sh` > The [Unix script] will check if Rust, pnpm and Xcode are installed and proceed to use Homebrew to install NASM, [Tauri essentials] and install any other required dependencies for OneLauncher to build. 3. For Windows users, run in PowerShell: `powershell -ExecutionPolicy Bypass -File .\packages\scripts\setup.ps1` diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..b9ebebdd --- /dev/null +++ b/flake.lock @@ -0,0 +1,98 @@ +{ + "nodes": { + "crane": { + "locked": { + "lastModified": 1767744144, + "narHash": "sha256-9/9ntI0D+HbN4G0TrK3KmHbTvwgswz7p8IEJsWyef8Q=", + "owner": "ipetkov", + "repo": "crane", + "rev": "2fb033290bf6b23f226d4c8b32f7f7a16b043d7e", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1767609335, + "narHash": "sha256-feveD98mQpptwrAEggBQKJTYbvwwglSbOv53uCfH9PY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "250481aafeb741edfe23d29195671c19b36b6dca", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1767767207, + "narHash": "sha256-Mj3d3PfwltLmukFal5i3fFt27L6NiKXdBezC1EBuZs4=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5912c1772a44e31bf1c63c0390b90501e5026886", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1765674936, + "narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "crane": "crane", + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1767926800, + "narHash": "sha256-x0n73J6ufD/EhDlVdcoAmF0OQHZ+b0a2cKDc8RZyt+o=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "499e9eed88ff9494b6604205b42847e847dfeb91", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index d74dcf99..22ae4d13 100644 --- a/flake.nix +++ b/flake.nix @@ -1,13 +1,81 @@ { description = "Next-generation open source Minecraft launcher"; - inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - inputs.flake-parts.url = "github:hercules-ci/flake-parts"; - inputs.crane.url = "github:ipetkov/crane"; + inputs = { + nixpkgs = { + url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + flake-parts = { + url = "github:hercules-ci/flake-parts"; + }; + + crane = { + url = "github:ipetkov/crane"; + }; + + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs = { + nixpkgs = { + follows = "nixpkgs"; + }; + }; + }; + }; - outputs = inputs@{ flake-parts, ... }: + outputs = + inputs@{ flake-parts, rust-overlay, ... }: flake-parts.lib.mkFlake { inherit inputs; } { - systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; - perSystem = { config, pkgs, ... }: {}; + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + + perSystem = + { pkgs, system, ... }: + let + pkgs' = import inputs.nixpkgs { + inherit system; + overlays = [ rust-overlay.overlays.default ]; + }; + in + { + devShells.default = pkgs'.mkShell { + packages = with pkgs'; [ + (rust-bin.fromRustupToolchainFile ./rust-toolchain.toml) + + cargo-tauri + nodejs_24 + pnpm + eslint + typescript + + pkg-config + openssl + + gobject-introspection + at-spi2-atk + atkmm + cairo + gdk-pixbuf + glib + gtk3 + harfbuzz + librsvg + libsoup_3 + pango + webkitgtk_4_1 + ]; + + shellHook = '' + export GIO_MODULE_DIR="${pkgs.glib-networking}/lib/gio/modules/" + pnpm i + pnpm prep + ''; + }; + }; }; }