dev: nix environment

This commit is contained in:
2026-09-03 20:12:49 +00:00
parent e6c9e65417
commit f063db3568
7 changed files with 1356 additions and 45 deletions
+19 -29
View File
@@ -1,38 +1,28 @@
{
description = "Bevy controls library and examples";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
hearth = {
url = "git+https://gitea.hectic-lab.com/hinterland/hearth.git";
inputs.nixpkgs.follows = "nixpkgs";
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
flake-utils.lib.eachDefaultSystem
(system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
rustToolchain = (pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml);
nativeBuildInputs = with pkgs; [ rustToolchain pkg-config ];
buildInputs = with pkgs; [
openssl
shellcheck
file
];
in
with pkgs;
{
devShells.default = mkShell {
inherit buildInputs nativeBuildInputs;
};
}
);
outputs = { self, hearth, ... }@inputs:
let
flake = builtins.warn "Using the `flake` variable may produce a large source closure." ./.;
lib = import ./lib { inherit inputs flake self; };
in
hearth.lib.forAllSystemsWithPkgs lib.composedOverlays ({ system, pkgs }: {
legacyPackages.${system} = pkgs;
packages.${system} = import ./package { inherit self inputs flake pkgs; };
devShells.${system} = import ./devshell { inherit self inputs flake pkgs; };
}) // {
inherit lib;
};
}