mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
50ff30ae5b
If we're going to be unstable, let's go all the way. This change was motivated by needing to upgrade cargo-machete to make it work with Rust v1.77, and not having the upgrade in nixos-unstable. V3_GIT_ORIGIN_REV_ID: 8191a376a6aeebc08787f973d58d373f8ab9ad0d
81 lines
2.1 KiB
Nix
81 lines
2.1 KiB
Nix
{
|
|
description = "DDN Engine";
|
|
|
|
inputs = {
|
|
nixpkgs.url = github:NixOS/nixpkgs;
|
|
flake-utils.url = github:numtide/flake-utils;
|
|
|
|
crane = {
|
|
url = "github:ipetkov/crane";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
rust-overlay = {
|
|
url = "github:oxalica/rust-overlay";
|
|
inputs = {
|
|
nixpkgs.follows = "nixpkgs";
|
|
flake-utils.follows = "flake-utils";
|
|
};
|
|
};
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils, crane, rust-overlay }:
|
|
flake-utils.lib.eachDefaultSystem (localSystem:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
system = localSystem;
|
|
overlays = [ rust-overlay.overlays.default ];
|
|
};
|
|
|
|
rust = import ./nix/rust.nix {
|
|
inherit nixpkgs rust-overlay crane localSystem;
|
|
};
|
|
in
|
|
{
|
|
formatter = pkgs.nixpkgs-fmt;
|
|
|
|
packages = {
|
|
# a binary for whichever is the local computer
|
|
default = rust.callPackage ./nix/app.nix {
|
|
version = if self ? "dirtyRev" then self.dirtyShortRev else self.shortRev;
|
|
};
|
|
};
|
|
|
|
apps = {
|
|
default = self.apps.${localSystem}.engine;
|
|
engine = flake-utils.lib.mkApp {
|
|
drv = self.packages.${localSystem}.default;
|
|
name = "engine";
|
|
};
|
|
custom-connector = flake-utils.lib.mkApp {
|
|
drv = self.packages.${localSystem}.default;
|
|
name = "custom-connector";
|
|
};
|
|
};
|
|
|
|
devShells = {
|
|
default = pkgs.mkShell {
|
|
# include dependencies of the default package
|
|
inputsFrom = [ self.packages.${localSystem}.default ];
|
|
|
|
# build-time inputs
|
|
nativeBuildInputs = [
|
|
# Development
|
|
pkgs.just
|
|
pkgs.nixpkgs-fmt
|
|
|
|
# Rust
|
|
pkgs.cargo-edit
|
|
pkgs.cargo-expand
|
|
pkgs.cargo-flamegraph
|
|
pkgs.cargo-insta
|
|
pkgs.cargo-machete
|
|
pkgs.cargo-nextest
|
|
pkgs.cargo-watch
|
|
rust.rustToolchain
|
|
];
|
|
};
|
|
};
|
|
});
|
|
}
|