Skip to content

Conversation

@taciturnaxolotl
Copy link
Contributor

  • I have read CONTRIBUTING.md.
  • I have created a discussion that was approved by a maintainer (for new features).

This will need to be merged into #33 with the actual update of the config. This is just the script update

@taciturnaxolotl taciturnaxolotl requested a review from a team as a code owner November 10, 2025 19:54
@taciturnaxolotl taciturnaxolotl requested review from raphamorim and tauraamui and removed request for a team November 10, 2025 19:54
@malikwirin
Copy link
Contributor

Have you run a linter on that python file?

@taciturnaxolotl
Copy link
Contributor Author

not yet; what linter would you prefer me to use?

@taciturnaxolotl
Copy link
Contributor Author

I ran ruff on it and it didn't find anything while linting, but it did reformat it.

Screenshot 2025-11-12 at 09 13 55

@malikwirin
Copy link
Contributor

not yet; what linter would you prefer me to use?

Black is somewhat of the standard in the Nix community, but I personally also prefer ruff even though without configuration it is not as strict

I was asking because of a dislike for variables and function executions in global namespace. Those things fit better in a main function

@taciturnaxolotl
Copy link
Contributor Author

sweet! I'll run it through black too then; I don't write much python except for random one off scripts so thats quite helpful :)

@taciturnaxolotl
Copy link
Contributor Author

how does that look?

@malikwirin
Copy link
Contributor

how does that look?

Does looks way better. I can properly review it tomorrow.
The script is for generating and updating the settings.nix based on the actual options provided by crush?

@taciturnaxolotl
Copy link
Contributor Author

it is! It uses the JSON schema

@taciturnaxolotl
Copy link
Contributor Author

I probably should modify the script to make a check the current crush version first and pull the proper version from GitHub instead of just using the latest schema

@malikwirin
Copy link
Contributor

I will try out the script on top of #33. How is one supposed to use it? Can you add a README.md for the scripts/ directory?

@taciturnaxolotl
Copy link
Contributor Author

Done! Just run it like ./scripts/generate-options.sh > modules/crush/options.nix

@malikwirin
Copy link
Contributor

Done! Just run it like ./scripts/generate-options.sh > modules/crush/options.nix

This wont work if it is actually supposed to build upon #33 as I renamed modules/crush/options.nix to modules/crush/options/settings.nix to seperate the configuration options from nix module typical options like package

If this PR is supposed to be able to be merged before #33 I can fix that in my PR should it happen

@taciturnaxolotl
Copy link
Contributor Author

I was originally thinking this would be merged first but it probably makes more sense to merge after yours

@malikwirin
Copy link
Contributor

I was originally thinking this would be merged first but it probably makes more sense to merge after yours

Its not up to me, but I would suggest changes that could be merged at any time. Depending on the merge order we can fix the file and path naming easily. options --> settings

@taciturnaxolotl
Copy link
Contributor Author

yeah i'll keep it like this till we need it then

@taciturnaxolotl
Copy link
Contributor Author

Good to merge @aymanbagabas! I'll look at trying to trigger that script whenever crush updates

@taciturnaxolotl
Copy link
Contributor Author

as per discussion on the slack I moved the script over to using go generator and added a github action

Copy link
Contributor

@malikwirin malikwirin left a comment

Choose a reason for hiding this comment

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

Maybe rename the script to generate-crush-settings.go as well. Because of the path of the script its not obvious that it would only generate the setting of crush. (I know currently it is the only module but still)

@taciturnaxolotl
Copy link
Contributor Author

should be good to go!

@malikwirin
Copy link
Contributor

Sorry if this is bothering but I still am kinda unhappy with the naming. The name of the script implies that it generates the options of crush. But it only generates the options related to the configuration that without the module happens in the ~/.config directory.

@taciturnaxolotl
Copy link
Contributor Author

oh fair lol

@taciturnaxolotl
Copy link
Contributor Author

renamed to workflow to follow the same convention as well

Copy link
Contributor

@malikwirin malikwirin left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants