bevy-playground/flake.nix

75 lines
1.7 KiB
Nix
Raw Normal View History

2023-12-19 10:35:34 -06:00
{
2024-07-30 10:06:09 -05:00
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
git-hooks.url = "github:cachix/git-hooks.nix";
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
};
2023-12-19 10:35:34 -06:00
outputs = {
self,
2024-07-30 10:06:09 -05:00
git-hooks,
2023-12-19 10:35:34 -06:00
nixpkgs,
}: let
2023-12-19 11:17:49 -06:00
inherit (self) outputs;
2024-07-30 10:06:09 -05:00
inherit (outputs) overlays;
systems = ["aarch64-linux" "aarch64-darwin" "x86_64-darwin" "x86_64-linux"];
forSystems = nixpkgs.lib.genAttrs systems;
pkgsFor = system: (import nixpkgs {inherit system;}).extend overlays.default;
genPkgs = func: (forSystems (system: func (pkgsFor system)));
2023-12-19 10:35:34 -06:00
in {
2024-07-30 10:06:09 -05:00
checks = genPkgs ({system, ...}: {
git-hooks = git-hooks.lib.${system}.run {
src = ./.;
hooks = {
alejandra.enable = true;
cargo-check.enable = true;
clippy.enable = true;
rustfmt.enable = true;
};
};
});
packages = genPkgs (pkgs: {
kodotag = pkgs.rustPlatform.buildRustPackage {
pname = "kodotag";
version = "0.1.0";
nativeBuildInputs = with pkgs; [
pkg-config
];
2023-12-19 10:35:34 -06:00
buildInputs = with pkgs; [
2023-12-19 11:17:49 -06:00
clang
2023-12-19 10:35:34 -06:00
cargo
rustc
rustfmt
rustPackages.clippy
2024-07-30 10:06:09 -05:00
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
2023-12-19 10:35:34 -06:00
rust-analyzer
2023-12-19 11:17:49 -06:00
mold
udev
alsa-lib
vulkan-loader
libxkbcommon
wayland
2023-12-19 10:35:34 -06:00
];
2024-07-30 10:06:09 -05:00
src = ./.;
hash = pkgs.lib.fakeHash;
cargoHash = "sha256-W7VQlMktGsRPQL9VGVmxYV6C5u2eJ48S7eTpOM+3n8U=";
2023-12-19 10:35:34 -06:00
};
2024-07-30 10:06:09 -05:00
default = outputs.packages.${pkgs.system}.kodotag;
2023-12-19 10:35:34 -06:00
});
2024-07-30 10:06:09 -05:00
overlays = {
default = final: prev: {};
};
formatter = genPkgs (p: p.alejandra);
2023-12-19 10:35:34 -06:00
};
}