Stream: nixos

Topic: Multi-config repos and sharing of nixpkgs


view this post on Zulip Srid (May 22 2024 at 19:32):

Ideas on this are welcome:

https://github.com/srid/nixos-flake/issues/51

(Need this for a Juspay internal repo, actually)

view this post on Zulip Shivaraj B H (May 23 2024 at 13:04):

I tried this: https://github.com/shivaraj-bh/nixos-flake/commit/183fc4d5a38875a9e2cf97728f3b354a25295f2e

It works if we don’t use nixosModules.home-manager.That can be fixed, if we allowspecifying home-manger input as well

view this post on Zulip Shivaraj B H (May 23 2024 at 13:04):

This will break the existing API though

view this post on Zulip Srid (May 23 2024 at 14:58):

I have tried that approach. Two disadvantages to it:

To address the coupling issue, I thought of just dedicating a flake to each host, whilst sharing common modules from the root flake. So:

# Root flake, with common modules and inputs
./flake.nix

# Host A with its own nixpkgs, etc.
./hosts/a/flake.nix

# Host B with its own nixpkgs, etc.
./hosts/b/flake.nix

There are still some issues with it; I'll have revisit it.


Last updated: Nov 15 2024 at 11:45 UTC