big refactor

Fix. Everything.

Co-authored-by: Andrei Cravtov <the.andrei.cravtov@gmail.com>
Co-authored-by: Matt Beton <matthew.beton@gmail.com>
Co-authored-by: Alex Cheema <alexcheema123@gmail.com>
Co-authored-by: Seth Howes <sethshowes@gmail.com>
This commit is contained in:
Evan Quiney
2025-09-30 11:03:04 +01:00
committed by GitHub
parent 7040c9508f
commit 38ff949bf4
171 changed files with 8295 additions and 4614 deletions

View File

@@ -20,47 +20,39 @@
# Provides flake integration with [Just](https://just.systems/man/en/)
just-flake.url = "github:juspay/just-flake";
# Provides Rust dev-env integration:
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
# TODO: figure out caching story
# nixConfig = {
# # nix community cachix
# extra-trusted-public-keys = "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=";
# extra-substituters = "https://nix-community.cachix.org";
# };
outputs =
inputs@{
flake-parts,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } (
{
flake-parts-lib,
self,
...
}:
let
nixpkgs-lib = inputs.nixpkgs.lib;
# A wraper around importApply that supplies default parameters
importApply' =
path: extraParams:
(flake-parts-lib.importApply path (
nixpkgs-lib.recursiveUpdate {
localSelf = self;
inherit flake-parts-lib;
inherit nixpkgs-lib;
} extraParams
));
# instantiate all the flake modules, passing custom arguments to them as needed
flakeModules = {
flakeRoot = importApply' ./.flake-modules/flake-root.nix { inherit (inputs) flake-root; };
justFlake = importApply' ./.flake-modules/just-flake.nix { inherit (inputs) just-flake; };
goForwarder = importApply' ./.flake-modules/go-forwarder.nix { };
};
in
{ flake-parts-lib, self, ... }:
{
imports = [
inputs.make-shell.flakeModules.default
flakeModules.flakeRoot
flakeModules.justFlake
flakeModules.goForwarder
./.flake-modules/macmon.nix
./nix/modules/pkgs-init.nix # nixpkgs overlays manager
./nix/modules/flake-root.nix
./nix/modules/just-flake.nix
./nix/modules/macmon.nix
./nix/modules/python.nix
./nix/modules/rust.nix
./nix/modules/go-forwarder.nix
];
systems = [
"x86_64-linux"
@@ -75,55 +67,31 @@
system,
...
}:
let
buildInputs = with pkgs; [
];
nativeBuildInputs = with pkgs; [
];
in
{
# Per-system attributes can be defined here. The self' and inputs'
# module parameters provide easy access to attributes of the same
# system.
# NOTE: pkgs is equivalent to inputs'.nixpkgs.legacyPackages.hello;
apps = {
python-lsp = {
type = "app";
program = "${pkgs.basedpyright}/bin/basedpyright-langserver";
};
default = self'.apps.forwarder;
};
apps = { };
make-shells.default = {
packages = [
pkgs.python313
pkgs.uv
pkgs.protobuf
pkgs.basedpyright
pkgs.ruff
];
nativeBuildInputs =
with pkgs;
[
nixpkgs-fmt
cmake
]
++ buildInputs
++ nativeBuildInputs;
# Arguments which are intended to be environment variables in the shell environment
# should be changed to attributes of the `env` option
env = {
# fixes libstdc++.so issues and libgl.so issues
LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib";
};
nativeBuildInputs = with pkgs; [
nixpkgs-fmt
];
shellHook = ''
export GO_BUILD_DIR=$(git rev-parse --show-toplevel)/build;
export DASHBOARD_DIR=$(git rev-parse --show-toplevel)/dashboard;
'';
# Arguments which are intended to be environment variables in the shell environment
# should be changed to attributes of the `env` option
env = { };
# Arbitrary mkDerivation arguments should be changed to be attributes of the `additionalArguments` option
additionalArguments = { };
};