Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flake: make lib an option of darwinSystem #1350

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rhoriguchi
Copy link

With nixosSystem you do this, so you can add your own custom functions to lib.

let lib = (_: super: { custom = import ./lib.nix { lib = super; }; });
in nixosConfigurations.host1 = lib.nixosSystem { ... }

This allows you to pass lib to darwinSystem so you can use the custom functions in nix-darwin.

@rhoriguchi rhoriguchi changed the title flake: make lib configurable flake: make lib an option of darwinSystem Feb 25, 2025
@emilazy
Copy link
Collaborator

emilazy commented Feb 25, 2025

This should already work if you pass lib = … to darwinSystem. Though I don’t recommend it; mismatching lib and pkgs can cause all kinds of headaches. It’s better to use specialArgs to inject your own separate library instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants