Thanks to visit codestin.com
Credit goes to github.com

Skip to content

srid/monorepo-nix-template

Repository files navigation

monorepo-nix-template

A simple demonstration of writing a top-level flake.nix that delegates to the inner default.nix (flake alike) of a sub-project. This pattern is useful in monorepos with many sub-projects written in different programming languages.

Files of interest:

  • flake.nix -- top-level flake
  • haskell/project.nix -- haskell flake-alike
  • rust/project.nix -- rust flake-alike

Features

  • Haskell app statically links to Rust library
  • Works on Linux and macOS (M1)
  • IDE experience works for both languages through HLS.
  • Autoformat by treefmt

Haskell

The Haskell programs links with the Rust library.

nix develop -c sh -c "cd ./haskell && cabal run"

Rust

nix develop -c sh -c "cd ./rusty && cargo build"

Nix

Run the full program,

nix run

Just build it,

nix build

Alternative approaches

About

Make monorepos with Nix flakes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published