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

Refactor Configurations with Per-machine Granularity Approach #9

Merged
merged 31 commits into from
Oct 17, 2024

Conversation

rennsax
Copy link
Owner

@rennsax rennsax commented Oct 17, 2024

This PR introduces significant changes by refactoring nearly the entire project.

After using Nix to manage my home configurations for some time, I found the Slot and Plugin paradigm I introduced in #4 is not as effective as I had hoped. The primary issue is that it’s unrealistic to expect different machines to share the same "slot" or several "plugins". Each machine's environment has subtle differences that are difficult to "de-couple".

To ensure full flexibility and extensibility, it's preferable to maintain a distinctive configuration for each machine, only sharing the modules and global variables.

Things Done:

  • Design a new directory layout
  • Adapt for home-manager, nixos-rebuild and darwin-rebuild by utilizing a specific function. It allows me to use these scripts while applying the desired configuration layout.
  • Migrate cheatsheets to a separate repo, which streamlines this repo and reduces trivial updates.
  • Remove unused or unnecessary modules and libs, as many were just premature design :(
  • Correct other issues, like lazy evaluation and the use of stdenv.hostPlatform.is{Darwin,Linux}.

Resolve infinite evaluation by correctly deferring.
I can keep my preferred output layouts, but also enjoy the convenience of
home-manager, darwin-rebuild and nixos-rebuild!
It needs rewrites.
Rather than "darwin-specified", they are my macbook-sepcified, in fact.
Since I've written a normalizing function, this patch is useless now.

However, I do hope the flake system can support a more flexible paradigm in the
future.
@rennsax rennsax added the enhancement New feature or request label Oct 17, 2024
@rennsax rennsax merged commit ecce18b into main Oct 17, 2024
1 check passed
@rennsax rennsax deleted the refactor-per-machine branch October 28, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant