Update: Base done
This commit is contained in:
99
flake.nix
99
flake.nix
@@ -10,50 +10,77 @@
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs @ { self, nixpkgs, rust-overlay, ... }:
|
||||
outputs =
|
||||
inputs@{
|
||||
self,
|
||||
nixpkgs,
|
||||
rust-overlay,
|
||||
...
|
||||
}:
|
||||
let
|
||||
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ rust-overlay.overlays.default ];
|
||||
};
|
||||
});
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
forEachSupportedSystem =
|
||||
f:
|
||||
nixpkgs.lib.genAttrs supportedSystems (
|
||||
system:
|
||||
f {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ rust-overlay.overlays.default ];
|
||||
};
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
# Define the package (your Rust binary)
|
||||
packages = forEachSupportedSystem ({ pkgs }: {
|
||||
default = pkgs.rustPlatform.buildRustPackage {
|
||||
name = "bitBeam";
|
||||
src = ./.;
|
||||
packages = forEachSupportedSystem (
|
||||
{ pkgs }:
|
||||
{
|
||||
default = pkgs.rustPlatform.buildRustPackage {
|
||||
name = "bitBeam";
|
||||
src = ./.;
|
||||
|
||||
# Specify dependencies (replace with your project's actual dependencies)
|
||||
buildInputs = [ pkgs.openssl pkgs.pkg-config ];
|
||||
# Specify dependencies (replace with your project's actual dependencies)
|
||||
buildInputs = [
|
||||
pkgs.openssl
|
||||
pkgs.pkg-config
|
||||
];
|
||||
|
||||
# Generate this with `cargo generate-lockfile` if you don't have it
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
# Generate this with `cargo generate-lockfile` if you don't have it
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
};
|
||||
|
||||
# Optional: Override the Rust version if needed
|
||||
nativeBuildInputs = [ pkgs.rust-bin.stable.latest.default ];
|
||||
};
|
||||
|
||||
# Optional: Override the Rust version if needed
|
||||
nativeBuildInputs = [ pkgs.rust-bin.stable.latest.default ];
|
||||
};
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
# Development environment (existing setup)
|
||||
devShells = forEachSupportedSystem ({ pkgs }: {
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
rust-bin.stable.latest.default
|
||||
openssl
|
||||
pkg-config
|
||||
cargo-deny
|
||||
cargo-edit
|
||||
cargo-watch
|
||||
rust-analyzer
|
||||
];
|
||||
RUST_SRC_PATH = "${pkgs.rust-bin.stable.latest.default}/lib/rustlib/src/rust/library";
|
||||
};
|
||||
});
|
||||
devShells = forEachSupportedSystem (
|
||||
{ pkgs }:
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
rust-bin.stable.latest.default
|
||||
openssl
|
||||
pkg-config
|
||||
cargo-deny
|
||||
cargo-edit
|
||||
cargo-watch
|
||||
rust-analyzer
|
||||
];
|
||||
RUST_SRC_PATH = "${pkgs.rust-bin.stable.latest.default}/lib/rustlib/src/rust/library";
|
||||
BITBEAM_DATABASE_URL = "sqlite://./bitbeam.sqlite";
|
||||
BITBEAM_DB_TYPE = "sqlite";
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user