dev: nix environment
This commit is contained in:
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user