diff --git a/.gitignore b/.gitignore index 2fe44401..5699135e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ builds/ /dist /temp /craft-fonts +result diff --git a/README.md b/README.md index 87e9a69f..7f6d707a 100644 --- a/README.md +++ b/README.md @@ -200,6 +200,23 @@ rustup target add wasm32-unknown-unknown cd apps/artcraft-launcher-web && trunk serve ``` +### Nix (experimental) + +`flake.nix` gives a dev shell (`nix develop`, then the cargo commands above) and a package: + +```sh +nix run github:storytold/craft-launcher +``` + +On NixOS this uses the system's graphics drivers. On other distros, a Nix-built program can't load +the host's GPU drivers, so the window may fail to open. Run it through +[nixGL](https://github.com/nix-community/nixGL) instead (NVIDIA needs nixGL's matching NVIDIA +variant), or use the AppImage, `.deb` or `.rpm` release: + +```sh +nix run --impure github:nix-community/nixGL -- nix run github:storytold/craft-launcher +``` + ### Installing your own builds To install and update the Craft apps from checkouts on your machine instead of GitHub, clone them diff --git a/flake.nix b/flake.nix index 92940a06..b50b9c09 100644 --- a/flake.nix +++ b/flake.nix @@ -65,12 +65,24 @@ nativeBuildInputs = with pkgs; [ pkg-config - cmake - ninja libclang + autoPatchelfHook ]; buildInputs = commonDeps; + runtimeDependencies = with pkgs; [ + wayland + libxkbcommon + libGL + vulkan-loader + #X11 support + libx11 + libxcursor + libxrandr + libxi + libxcb + ]; + doCheck = false; };