iamb/flake.nix

47 lines
1.5 KiB
Nix
Raw Normal View History

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 = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
2024-03-08 07:06:02 +01:00
"keybindings-0.0.1" = "sha256-0ZWJNmKdxbJq1W/fuxzyD5Yagu6KsO5WMHlcM51nDvo=";
};
};
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 = [
(rustNightly.override {
extensions = [ "rust-src" "rust-analyzer-preview" "rustfmt" "clippy" ];
})
2023-03-24 10:32:14 +00:00
pkg-config
cargo-tarpaulin
cargo-watch
2023-03-24 10:32:14 +00:00
];
};
});
}