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

hosts/*: remove lib.flatten usage #109

Merged
merged 1 commit into from
Apr 10, 2024
Merged

hosts/*: remove lib.flatten usage #109

merged 1 commit into from
Apr 10, 2024

Conversation

flokli
Copy link
Collaborator

@flokli flokli commented Apr 10, 2024

We can simply concatenate lists with the ++ operator, no need to call lib.flatten on a list of lists to archieve the same thing.

Also, remove the surrounding with statement in case it's only used once or twice, and sort file imports before others.

@flokli flokli force-pushed the remove-flatten-in-imports branch 2 times, most recently from 24b2fc3 to 341770a Compare April 10, 2024 10:36
We can simply concatenate lists with the `++` operator, no need to call
lib.flatten on a list of lists to archieve the same thing.

Also, remove the surrounding with statement in case it's only used once
or twice, and sort file imports before others.

Signed-off-by: Florian Klink <flokli@flokli.de>
@flokli flokli requested a review from joinemm April 10, 2024 11:09
@mkaapu
Copy link
Contributor

mkaapu commented Apr 10, 2024

Change LGTM, but how we are going to test this?

@flokli
Copy link
Collaborator Author

flokli commented Apr 10, 2024

It's only syntactic changes, the resulting nix expressions and store paths are the same before and after.

Edit: Ah no, they're not, due to the flake content hash itself also leaking into the expression. But a nix-instantiate -E '(import ./. {}).outputs.nixosConfigurations.binarycache.config.system.build.toplevel' before and after this PR for example, and invoking nix-diff on the two drv paths shows nothing substantial is changed.

@flokli flokli merged commit 8149653 into main Apr 10, 2024
2 checks passed
@flokli flokli deleted the remove-flatten-in-imports branch April 10, 2024 12:18
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.

5 participants