From ea750731471a221c559a57e37d12a9fdc0bdf6fc Mon Sep 17 00:00:00 2001 From: Savanni D'Gerinel Date: Sun, 9 Jul 2023 18:25:17 -0400 Subject: [PATCH] Add background information for the project --- Mononix/.obsidian/app.json | 4 ++- Mononix/.obsidian/workspace.json | 36 ++++++++++++++++--- Mononix/Index.md | 34 ++++++++++++++++-- Mononix/Nix For Development.md | 1 - ...onorepos.md => Rust build tools in Nix.md} | 10 +----- readme.md | 8 ++++- 6 files changed, 75 insertions(+), 18 deletions(-) rename Mononix/{Nix Monorepos.md => Rust build tools in Nix.md} (76%) diff --git a/Mononix/.obsidian/app.json b/Mononix/.obsidian/app.json index 9e26dfe..e609a07 100644 --- a/Mononix/.obsidian/app.json +++ b/Mononix/.obsidian/app.json @@ -1 +1,3 @@ -{} \ No newline at end of file +{ + "promptDelete": false +} \ No newline at end of file diff --git a/Mononix/.obsidian/workspace.json b/Mononix/.obsidian/workspace.json index f56b5ea..d81e83d 100644 --- a/Mononix/.obsidian/workspace.json +++ b/Mononix/.obsidian/workspace.json @@ -32,9 +32,36 @@ "source": false } } + }, + { + "id": "4d0f931be6c172b5", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "Nix For Development.md", + "mode": "source", + "backlinks": true, + "source": false + } + } + }, + { + "id": "bd24ffd92b4cc242", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "Nix should immediately make a person's time better.md", + "mode": "source", + "backlinks": true, + "source": false + } + } } ], - "currentTab": 1 + "currentTab": 1, + "stacked": true } ], "direction": "vertical" @@ -165,15 +192,16 @@ "active": "f8131571839b6055", "lastOpenFiles": [ "Nix For Development.md", + "Index.md", + "Nix Monorepos.md", + "Rust build tools in Nix.md", "Nix should immediately make a person's time better.md", + "cargo2nix.md", "Nix Flakes.md", "buildRustPackage.md", "buildRustCrate.md", "crate2nix.md", - "cargo2nix.md", "How can I interrogate a Nix builder.md", - "Index.md", - "Nix Monorepos.md", "Cross-compiling.md", "Makefiles and Monorepos.md", "Mononix, C library.md", diff --git a/Mononix/Index.md b/Mononix/Index.md index bf7c256..e214646 100644 --- a/Mononix/Index.md +++ b/Mononix/Index.md @@ -4,8 +4,37 @@ Goal: Using one coherent build tool, I can develop multiple projects with common # Background +I do a lot of Rust development. I also like to attach other programming languages so that I can, for instance, write a [go application that works in a web browser](https://git.luminescent-dreams.com/savanni/tools/src/branch/main/kifu/pwa). And, I tend to work in a [monorepo](https://git.luminescent-dreams.com/savanni/tools/), because that helps me keep all of my disparate interests somewhat in sync with one another. +Finally, I use Nix to manage my development tools. +However, what I cannot do is use Nix to actually build my projects. Most of my projects, admittedly, are Rust projects and so they are pretty easily built with a simple Cargo.toml. However, as soon as I want to do something complicated, such as a web application, I have to dig extensively to find documentation on how to actually lay out the application and get all of the tools in place. Plus, I have to use a different build tool and get all of the build tools to work together. + +What I actually want to do is this. + +``` +> nix run .#kifu-gtk +``` + +And I want you to be able to just say this... + +``` +> nix run https://git.luminescent-dreams.com/savanni/tools/#.kifu-gtk +``` + +## Monorepos + +For the purpose of this project, a monorepo as a single Git repository which contains potentially many libraries and applications, in separate packages (rust Crates, node Modules, etc), which interdepend and may be developed simultaneously with one another. + +## Past experiences + +I don't have many past experiences. + +- I have the 1Password Monorepo, which is mostly held together with Makefiles which invoke platform-specific build tools. These were put together before I arrived at the company, and they are extensive. The developer build environment does not match the CI build environment. +- I have tried Bazel, but have not been able to build a purely Rust project even while following the tutorials. +- I have my [Tools Monorepo](https://git.luminescent-dreams.com/savanni/tools/) where I use a bunch of Makefiles to invoke platform-specific build commands. This doesn't work too badly, but I've hand-rolled every boilerplate Makefile, and should I want to add something like cross-compilation to Raspberry Pi, I am in for a world of pain. + +I have evaluated all but one of the [[Rust build tools in Nix]], and found significant drawbacks in each. The biggest drawback, though, is that the tools are all for building an application. Binding two applications together is never a consideration with any of the build tools, and so something like the Kifu PWA application simply cannot be built with Nix as a build tool. # Requirements - select the toolchains and versions thereof for the project @@ -52,8 +81,9 @@ Backends Each of these is a separate Nix command that builds or runs the desired result. --- -- [[Nix Monorepos]] - [[Nix For Development]] - [[Cross-compiling]] - [[Scaling Rust Builds with Bazel]] -- [[Makefiles and Monorepos]] \ No newline at end of file +- [[Makefiles and Monorepos]] +- [Experiment in cross-compiling](https://github.com/jraygauthier/jrg-rust-cross-experiment/blob/master/simple-static-rustup-target-windows/shell.nix) +- [Building Nix flakes from Rust workspaces - Tweag](https://www.tweag.io/blog/2022-09-22-rust-nix/) diff --git a/Mononix/Nix For Development.md b/Mononix/Nix For Development.md index 824e843..8b68c36 100644 --- a/Mononix/Nix For Development.md +++ b/Mononix/Nix For Development.md @@ -17,7 +17,6 @@ --- - [[Nix should immediately make a person's time better]] -- [[Nix Monorepos]] - [[Scaling Rust Builds with Bazel]] - [[Nix Flakes]] - [[crate2nix]] \ No newline at end of file diff --git a/Mononix/Nix Monorepos.md b/Mononix/Rust build tools in Nix.md similarity index 76% rename from Mononix/Nix Monorepos.md rename to Mononix/Rust build tools in Nix.md index c118414..6b7a4cc 100644 --- a/Mononix/Nix Monorepos.md +++ b/Mononix/Rust build tools in Nix.md @@ -1,7 +1,3 @@ - -- [Experiment in cross-compiling](https://github.com/jraygauthier/jrg-rust-cross-experiment/blob/master/simple-static-rustup-target-windows/shell.nix) -- [Building Nix flakes from Rust workspaces - Tweag](https://www.tweag.io/blog/2022-09-22-rust-nix/) - # Rust ## Tools @@ -16,8 +12,4 @@ I am building this table to evaluate tools from the perspective that I would wan | [[crate2nix]] | | | no | | [[naersk]] | | | | -Nothing short of caching each dependency in a separate crate will make a tool acceptable for monorepo development. - -# A strategy - -- Each crate needs to be treated as a separate +Nothing short of caching each dependency in a separate crate will make a tool acceptable for monorepo development. \ No newline at end of file diff --git a/readme.md b/readme.md index c294c63..dab603b 100644 --- a/readme.md +++ b/readme.md @@ -2,4 +2,10 @@ Monorepo tools using Nix as the build, link, and package tool. -See [the documentation index](Mononix/Index.md) for more detailed documentation. +- [Documentation Index](Mononix/Index.md) +- [Tracker](https://www.pivotaltracker.com/n/projects/2650555) +- [Demo Repository](https://git.luminescent-dreams.com/savanni/demo-repo) + +# Usage + +There is no code yet, so there are no usage instructions