49 lines
1.5 KiB
Nix
49 lines
1.5 KiB
Nix
{
|
|
description = "Prymn";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
rust-overlay = {
|
|
url = "github:oxalica/rust-overlay";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
};
|
|
crane = {
|
|
url = "github:ipetkov/crane";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
inputs.rust-overlay.follows = "rust-overlay";
|
|
};
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils, rust-overlay, crane }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
overlays = [ (import ./nix/overlay.nix) (import rust-overlay) ];
|
|
pkgs = import nixpkgs { inherit system overlays; };
|
|
scripts = pkgs.callPackage ./nix/scripts.nix { };
|
|
rustBuilder = import ./nix/rust.nix { inherit crane pkgs system; };
|
|
in
|
|
{
|
|
devShells.default = with pkgs; mkShell {
|
|
packages = [
|
|
elixir
|
|
elixir-ls
|
|
rustToolchain
|
|
scripts.prymn_db
|
|
] ++ lib.optionals stdenv.isLinux [ inotify-tools ];
|
|
|
|
shellHook = ''
|
|
export PROJECT_ROOT_DIR="$PWD"
|
|
'';
|
|
};
|
|
|
|
checks.rustTest = rustBuilder.test;
|
|
checks.rustClippy = rustBuilder.clippy;
|
|
checks.rustFormat = rustBuilder.format;
|
|
|
|
packages.agent-x86_64-linux = rustBuilder.package "x86_64-linux";
|
|
packages.agent-aarch64-linux = rustBuilder.package "aarch64-linux";
|
|
});
|
|
}
|