2024-03-06 14:38:27 +03:00
|
|
|
{
|
|
|
|
description = "DDN Engine";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
|
|
|
|
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;
|
2024-03-06 20:50:32 +03:00
|
|
|
|
2024-03-06 14:38:27 +03:00
|
|
|
packages = {
|
|
|
|
# a binary for whichever is the local computer
|
2024-03-06 20:50:32 +03:00
|
|
|
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";
|
|
|
|
};
|
2024-03-21 19:48:53 +03:00
|
|
|
custom-connector = flake-utils.lib.mkApp {
|
2024-03-06 20:50:32 +03:00
|
|
|
drv = self.packages.${localSystem}.default;
|
2024-03-21 19:48:53 +03:00
|
|
|
name = "custom-connector";
|
2024-03-06 20:50:32 +03:00
|
|
|
};
|
2024-03-06 14:38:27 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
|
pkgs.rnix-lsp
|
|
|
|
rust.rustToolchain
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|