hercules-ci / flake-parts

❄️ Simplify Nix Flakes with the module system
https://flake.parts
MIT License
721 stars 41 forks source link

Add dogfood template (fix #104 and #121) #156

Closed Atry closed 1 year ago

Atry commented 1 year ago

Motivation

git+file:///Users/twer/github/flake-parts?dir=template/dogfood
├───apps
│   ├───aarch64-darwin
│   │   └───default: app
│   └───x86_64-linux
│       └───default: app
├───flakeModule: unknown
├───flakeModules: unknown
└───packages
    ├───aarch64-darwin
    │   └───hello_22_11: package 'hello-2.12.1'
    └───x86_64-linux
        └───hello_22_11 omitted (use '--all-systems' to show)
nix repl
Welcome to Nix 2.15.0. Type :? for help.

nix-repl> :lf .
warning: Git tree '/Users/twer/github/flake-parts' is dirty
Added 20 variables.

nix-repl> flakeModules
{ anotherFlakeModule = { ... }; dogfood = { ... }; hello = { ... }; }

nix-repl> 
roberth commented 1 year ago

Perhaps a way to work around the problem posed by graphs of public flakeModules is to set the module key by hand (EDIT: inside the module file, or by wrapping the module where you perform your local imports) for now. I don't think we should bless that solution with a template until we've tried a mkFlake-based solution, but it seems that it would unblock your actual module implementation work for the time being.