mirror of
https://github.com/storytold/craft-launcher.git
synced 2026-10-13 14:59:07 +00:00
* Add experimental flake.nix for NixOS/Linux development This adds an experimental flake-based development environment and package entry for ArtCraft Launcher. What this adds: - `flake.nix` at the repository root - Rust toolchain via `rust-overlay` - Required native Linux libraries for the Rust workspace - A dev shell via `nix develop` - A package/app target via `nix run` / `nix build` Why: ArtCraft Launcher is a Rust workspace and currently has no Nix flake support. This makes local development and installation much easier for NixOS/Linux users. Notes: - This is intentionally minimal and experimental. - It targets the development environment and local package use. - Additional refinements may be needed for specific Wayland/X11 setups. * Fix flake metadata to match ArtCraft Launcher and remove GTK dependency * add flake.lock * Update flake.nix: replace deprecated xorg packages with their new names
83 lines
2.0 KiB
Nix
83 lines
2.0 KiB
Nix
{
|
|
description = "Experimental Nix flake for ArtCraft Launcher";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
overlays = [ rust-overlay.overlays.default ];
|
|
};
|
|
|
|
rust = pkgs.rust-bin.stable.latest.default.override {
|
|
extensions = [ "rustfmt" "clippy" "rust-src" ];
|
|
};
|
|
|
|
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).workspace.package.version;
|
|
|
|
commonDeps = with pkgs; [
|
|
pkg-config
|
|
openssl
|
|
libxkbcommon
|
|
libx11
|
|
libxcursor
|
|
libxrandr
|
|
libxi
|
|
libxcb
|
|
libGL
|
|
vulkan-loader
|
|
mesa
|
|
wayland
|
|
wayland-protocols
|
|
fontconfig
|
|
freetype
|
|
alsa-lib
|
|
zlib
|
|
];
|
|
in
|
|
{
|
|
devShells.default = pkgs.mkShell {
|
|
nativeBuildInputs = with pkgs; [
|
|
rust
|
|
cmake
|
|
ninja
|
|
libclang
|
|
];
|
|
buildInputs = commonDeps;
|
|
|
|
shellHook = ''
|
|
export LIBCLANG_PATH="${pkgs.libclang.lib}/lib"
|
|
export PKG_CONFIG_PATH="${pkgs.openssl.dev}/lib/pkgconfig:$PKG_CONFIG_PATH"
|
|
'';
|
|
};
|
|
|
|
packages.default = pkgs.rustPlatform.buildRustPackage {
|
|
pname = "artcraft-launcher";
|
|
version = version;
|
|
src = ./.;
|
|
cargoLock.lockFile = ./Cargo.lock;
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
pkg-config
|
|
cmake
|
|
ninja
|
|
libclang
|
|
];
|
|
buildInputs = commonDeps;
|
|
|
|
doCheck = false;
|
|
};
|
|
|
|
apps.default = {
|
|
type = "app";
|
|
program = "${self.packages.${system}.default}/bin/artcraft-launcher";
|
|
};
|
|
});
|
|
}
|