color_cube/flake.nix
2024-04-18 15:32:09 -04:00

38 lines
987 B
Nix

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
crane = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:ipetkov/crane";
};
};
outputs = { self, nixpkgs, crane }:
let supportedSystems = [ "aarch64-linux" "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in {
packages = forAllSystems (system: let pkgs = nixpkgsFor.${system}; in {
default = crane.lib.${system}.buildPackage {
src = ./.;
STARDUST_RES_PREFIXES = pkgs.stdenvNoCC.mkDerivation {
name = "resources";
src = ./.;
buildPhase = "cp -r $src/res $out";
};
};
});
devShells = forAllSystems (system: let pkgs = nixpkgsFor.${system}; in {
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
cargo
rustc
];
};
});
};
}