76 lines
1.8 KiB
Nix
76 lines
1.8 KiB
Nix
{
|
|
description = "rate_music - built with standard buildRustPackage";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
rust-overlay,
|
|
flake-utils,
|
|
...
|
|
}:
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system:
|
|
let
|
|
overlays = [ (import rust-overlay) ];
|
|
pkgs = import nixpkgs { inherit system overlays; };
|
|
|
|
# Use the latest stable rust toolchain from the overlay
|
|
rustToolchain = pkgs.rust-bin.stable.latest.default;
|
|
|
|
# Create a rustPlatform using our specific toolchain
|
|
rustPlatform = pkgs.makeRustPlatform {
|
|
cargo = rustToolchain;
|
|
rustc = rustToolchain;
|
|
};
|
|
|
|
# System dependencies for your specific crates
|
|
nativeBuildInputs = with pkgs; [
|
|
pkg-config
|
|
rustToolchain
|
|
];
|
|
buildInputs =
|
|
with pkgs;
|
|
[
|
|
sqlite
|
|
openssl
|
|
dbus
|
|
]
|
|
++ lib.optionals stdenv.isDarwin [
|
|
darwin.apple_sdk.frameworks.Security
|
|
darwin.apple_sdk.frameworks.SystemConfiguration
|
|
];
|
|
|
|
in
|
|
{
|
|
packages.default = rustPlatform.buildRustPackage {
|
|
pname = "rate_music";
|
|
version = "0.1.0";
|
|
|
|
src = ./.;
|
|
|
|
cargoLock = {
|
|
lockFile = ./Cargo.lock;
|
|
};
|
|
|
|
inherit buildInputs nativeBuildInputs;
|
|
|
|
buildType = "release";
|
|
};
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
inherit buildInputs nativeBuildInputs;
|
|
shellHook = ''
|
|
export DATABASE_URL="sqlite:./rate_music.db"
|
|
'';
|
|
};
|
|
}
|
|
);
|
|
}
|