Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.
/ nix-monorepo Public archive

An illustration of how you might use Nix in a large, multi-language project and in accordance with best practices

Notifications You must be signed in to change notification settings

lucperkins/nix-monorepo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nix Monorepo

This project has deep debts to Christine Dodrill's blog, Domen Kožar's discussion of Nix anti-patterns, and Burke Libbey's YouTube channel.

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:

Project specifics

A few characteristics of the project worth mentioning:

  • This repo uses Niv to provide "pinned" versions of nixpkgs and some other repositories. I think that this approach is more declarative and "pure" than relying on the oft-encountered <nixpkgs>.
  • The 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

About

An illustration of how you might use Nix in a large, multi-language project and in accordance with best practices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published