[Feature] Refactor the code to make it more maintainable and readable #31

Closed
opened 2025-12-29 04:20:55 +01:00 by adam · 0 comments
Owner

Originally created by @ryan4yin on GitHub (Mar 9, 2024).

Why refactoring is needed?

My nix config was very simple at the beginning, but as I kept updating and adding new things, it became more and more complicated.

The current pain points of this project is:

  1. It's hard to read.
  2. It's hard to add a new host into the config, I have to edit several nix file very carefully.
  3. Every time I modified some shared configs, I have to deploy and test it on all my 20 hosts, which consumes energy and time.
  4. It's hard to refactor the config, nix's error message is obscure, and my poor project structure made it even worse.

The goal I want to achieve through refactoring

Sort by priority:

Originally created by @ryan4yin on GitHub (Mar 9, 2024). ## Why refactoring is needed? My nix config was very simple at the beginning, but as I kept updating and adding new things, it became more and more complicated. The current pain points of this project is: 1. It's **hard to read**. 1. It's **hard to add a new host** into the config, I have to edit several nix file very carefully. 2. Every time I modified some shared configs, I have to deploy and **test** it on all my 20 hosts, which consumes energy and time. 3. It's **hard to refactor** the config, nix's error message is obscure, and my poor project structure made it even worse. ## The goal I want to achieve through refactoring Sort by priority: - [x] **Make it simple and easy to add a new host**. #79 - [x] **Make refactoring and code modification more quickly and smoother by** - [x] Adding eval tests #88 - [x] Adding integration tests #93 - [x] Make it more readable, to myself.(Readability to beginners will not be considered...) #79
adam added the enhancement label 2025-12-29 04:20:55 +01:00
adam closed this issue 2025-12-29 04:20:55 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/nix-config-ryan4yin#31