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

[feature request] mark own modules as not imported by default #115

Open
pyrox0 opened this issue Jun 23, 2024 · 4 comments
Open

[feature request] mark own modules as not imported by default #115

pyrox0 opened this issue Jun 23, 2024 · 4 comments

Comments

@pyrox0
Copy link

pyrox0 commented Jun 23, 2024

I would like to be able to mark certain modules defined in my flake as not imported to all systems by default.

Currently, I have a module that configures a buildbot-nix worker. However, this means that I also have to add buildbot-nix.nixosModules.buildbot-worker to systems.modules.nixos so that all systems pick it up. This increases evaluation time and is also a lot "dirtier" in terms of what I'm importing, since most machines will not have the buildbot worker on them. Therefore, if I could mark a module as non-importable somehow, I could make it so that only machines that will run a worker will import this, and by extension, also the buildbot-worker module from buildbot-nix. Is this possible at all with snowfall?

@olifloof
Copy link

iirc you can use

systems.hosts.my-host.modules = with inputs; [
  # my-input.nixosModules.my-module
];

to make specific systems import a module

@olifloof
Copy link

wait you're already using that 🥴

@pyrox0
Copy link
Author

pyrox0 commented Jun 23, 2024

Yes, what I want to do is to make it so that self.nixosModules."services/buildbot"(which is defined in my flake) is not imported to all systems by default(which happens with all systems by default, per the first line of the Modules doc page), as it then requires me to import buildbot-nix.nixosModules.buildbot-worker to all systems.

@olifloof
Copy link

you could try - although it would be a bit awkward - to move the module to a separate repo and import from there

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

No branches or pull requests

2 participants