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

Add flake-parts module #5229

Merged
merged 2 commits into from
Jan 30, 2025
Merged

Conversation

MattSturgeon
Copy link
Member

@MattSturgeon MattSturgeon commented Apr 5, 2024

Description

Add a flake-parts module, output as flakeModules.home-manager and flakeModules.default.

The module defines options for flake.homeModules and flake.homeConfigurations, based on the respective nixos equivalents; flake.nixosModules and flake.nixosConfigurations.

This is mostly useful for people who want to define modules or configs in multiple flake modules. Without the options, they can still be defined, but the definition must be unique.

I've added some initial documentation, although I don't know how to build/browse the docs to check it renders how I expect.

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

Maintainer CC

MattSturgeon added a commit to MattSturgeon/nix-config that referenced this pull request Apr 5, 2024
MattSturgeon added a commit to MattSturgeon/nix-config that referenced this pull request Apr 5, 2024
@MattSturgeon
Copy link
Member Author

@rycee sorry for the ping, but are you able to review?

Copy link

stale bot commented Sep 6, 2024

Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting.

If you are the original author of the PR

  • GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. If you have addressed the reviews you can officially ask for a review from those who commented to you or anyone else.
  • If it is unfinished but you plan to finish it, please mark it as a draft.
  • If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
  • To get things rolling again, rebase the PR against the target branch and address valid comments.

If you are not the original author of the PR

  • If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.

@stale stale bot added the status: stale label Sep 6, 2024
@MattSturgeon
Copy link
Member Author

MattSturgeon commented Sep 6, 2024

I don't think there's any conflicts so I won't rebase just yet.

If someone is able to review I'm happy to address any feedback! 😁

@darren-recentive
Copy link

I don't think there's any conflicts so I won't rebase just yet.

If someone is able to review I'm happy to address any feedback! 😁

get_this_man
@rycee @onemoresuza pretty please 🙏

Copy link
Collaborator

@khaneliman khaneliman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks Matt!

@khaneliman khaneliman merged commit a5e196d into nix-community:master Jan 30, 2025
3 checks passed
@MattSturgeon MattSturgeon deleted the flake-parts branch January 30, 2025 18:57
@rycee rycee mentioned this pull request Jan 30, 2025
5 tasks
'';
};
homeModules = mkOption {
type = types.lazyAttrsOf types.unspecified;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for being a bit late but should the type not have been types.lazyAttrsOf types.deferredModule?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote this a long time ago, referencing the flake.parts nixosModules module. So I would've used whatever type flake.parts was using at the time.

But yes, deferredModule is a more appropriate type. Good spot.

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

Successfully merging this pull request may close these issues.

4 participants