Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucperkins/nix-monorepo
An illustration of how you might use Nix in a large, multi-language project and in accordance with best practices
https://github.com/lucperkins/nix-monorepo
Last synced: about 2 months ago
JSON representation
An illustration of how you might use Nix in a large, multi-language project and in accordance with best practices
- Host: GitHub
- URL: https://github.com/lucperkins/nix-monorepo
- Owner: lucperkins
- Archived: true
- Created: 2020-07-29T05:33:54.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-27T16:21:07.000Z (almost 2 years ago)
- Last Synced: 2024-06-17T19:02:00.233Z (3 months ago)
- Language: Elixir
- Homepage:
- Size: 492 KB
- Stars: 53
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nix Monorepo
> This project has deep debts to Christine Dodrill's [blog](https://christine.website/), [Domen Kožar](https://www.domenkozar.com)'s discussion of [Nix anti-patterns](https://nix.dev/anti-patterns/index.html), and Burke Libbey's [YouTube channel](https://www.youtube.com/channel/UCSW5DqTyfOI9sUvnFoCjBlQ).
This is a somewhat silly project intended to show you how you might use Nix in a larger, multi-language project. It's mostly a learning exercise for your truly. Each of the language directories here contains a simple, "hello world"-style project for that language that provides a Nix shell configuration (`shell.nix`). The current languages:
* [Elixir](./elixir)
* [Go](./golang)
* [Rust](./rust)## Project specifics
A few characteristics of the project worth mentioning:
* This repo uses [Niv](https://github.com/nmattia/niv) to provide "pinned" versions of [nixpkgs](https://github.com/nixos/nixpkgs) and some other repositories. I think that this approach is more declarative and "pure" than relying on the oft-encountered ``.
* The [`nix`](./nix) directory provides not just the generated `sources.nix` and `sources.json` files that Niv relies upon, but also a central source of language-specific Nix functions and variables that can be used by the language-specific sub-projects. This reduces the amount of boilerplate that's necessary in project-specific Nix files.## Project goal
The goal of this repo is mostly to provide an example of how one might structure a larger Nix project. I'm starting small with just shell configs, but eventually I'd like to:
* Expand the number of languages beyond the initial three (which were chosen simply because they're the languages I know best)
* Add Nix facilities for building the projects
* Add configs for building Docker images out of the projects