2023-03-24 10:32:14 +00:00
|
|
|
{
|
|
|
|
description = "iamb";
|
|
|
|
nixConfig.bash-prompt = "\[nix-develop\]$ ";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, flake-utils, rust-overlay, ... }:
|
|
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
|
|
|
# We only need the nightly overlay in the devShell because .rs files are formatted with nightly.
|
|
|
|
overlays = [ (import rust-overlay) ];
|
|
|
|
pkgs = import nixpkgs { inherit system overlays; };
|
|
|
|
rustNightly = pkgs.rust-bin.nightly."2023-03-17".default;
|
|
|
|
in
|
|
|
|
with pkgs;
|
|
|
|
{
|
|
|
|
packages.default = pkgs.rustPlatform.buildRustPackage {
|
|
|
|
pname = "iamb";
|
|
|
|
version = "0.0.7";
|
|
|
|
src = ./.;
|
2023-11-16 08:36:22 -08:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
# Remove this once modalkit gets pinned by version again.
|
|
|
|
outputHashes = {
|
|
|
|
"modalkit-0.0.16" = "sha256-mjAD1v0r2+SzPdoB2wZ/5iJ1NZK+3OSvCYcUZ5Ef38Y=";
|
|
|
|
};
|
|
|
|
};
|
2024-02-28 04:23:17 +01:00
|
|
|
nativeBuildInputs = [ pkgs.pkg-config ];
|
2023-06-07 22:26:17 +02:00
|
|
|
buildInputs = [ pkgs.openssl ] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin
|
|
|
|
(with pkgs.darwin.apple_sdk.frameworks; [ AppKit Security ]);
|
2023-03-24 10:32:14 +00:00
|
|
|
};
|
|
|
|
devShell = mkShell {
|
|
|
|
buildInputs = [
|
2023-11-16 08:36:22 -08:00
|
|
|
(rustNightly.override {
|
|
|
|
extensions = [ "rust-src" "rust-analyzer-preview" "rustfmt" "clippy" ];
|
|
|
|
})
|
2023-03-24 10:32:14 +00:00
|
|
|
pkg-config
|
|
|
|
cargo-tarpaulin
|
2023-11-16 08:36:22 -08:00
|
|
|
cargo-watch
|
2023-03-24 10:32:14 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|