Files
exo/flake.nix
Alex Cheema 92c9688bf0 Remove rust
2025-08-02 08:16:39 -07:00

82 lines
2.1 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
description = "The development environment for Exo";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = (import nixpkgs) {
inherit system;
};
# Go 1.23 compiler align with go.mod
go = pkgs.go_1_23;
# Build the networking/forwarder Go utility.
forwarder = pkgs.buildGoModule {
pname = "exo-forwarder";
version = "0.1.0";
src = ./networking/forwarder;
vendorHash = "sha256-BXIGg2QYqHDz2TNe8hLAGC6jVlffp9766H+WdkkuVgA=";
# Only the main package at the repository root needs building.
subPackages = [ "." ];
};
buildInputs = with pkgs; [
];
nativeBuildInputs = with pkgs; [
];
in
{
packages = {
inherit forwarder;
default = forwarder;
};
apps = {
forwarder = {
type = "app";
program = "${forwarder}/bin/forwarder";
};
python-lsp = {
type = "app";
program = "${pkgs.basedpyright}/bin/basedpyright-langserver";
};
default = self.apps.${system}.forwarder;
};
devShells.default = pkgs.mkShell {
packages = [
pkgs.python313
pkgs.uv
pkgs.just
pkgs.protobuf
pkgs.basedpyright
pkgs.ruff
go
];
# TODO: change this into exported env via nix directly???
shellHook = ''
export GOPATH=$(mktemp -d)
'';
nativeBuildInputs = with pkgs; [
nixpkgs-fmt
cmake
] ++ buildInputs ++ nativeBuildInputs;
# fixes libstdc++.so issues and libgl.so issues
LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib";
};
}
);
}