Skip to content

Conversation

@norberttech
Copy link
Member

Change Log

Added

  • Nix - for local development environment

Fixed

Changed

Removed

Deprecated

Security


Description

Reference: #1467

@norberttech
Copy link
Member Author

Since I'm not very advanced with Nix I had to use some help from GitHub Copilot to put those together.

@Ocramius @drupol could I bother you to take a look and share some feedback? 🙏 (I don't know anyone else more experienced in nix 😅)
I have been using mostly nix shell so this is still new approach for me and just want to make sure I'm not missing something obvious.

Wasn't sure about github:numtide/flake-utils (I don't like dependencies) but seems to be pretty useful for reducing the amount of boilerplate code.

Also does any of you by any chance know if there is a way to use nix flakes on github actions? That would be pretty amazing to have all php/os dependencies the same between local and ci/cd environments.

This PR is not yet ready to be merged, it's missing documentation in /docs/contributing.md and some nicer shell, now it looks like shit:

image

@norberttech
Copy link
Member Author

Also does any of you by any chance know if there is a way to use nix flakes on github actions? That would be pretty amazing to have all php/os dependencies the same between local and ci/cd environments.

https://determinate.systems/posts/nix-github-actions/ - seems to be possible and maybe not even that hard with those two actions

@drupol
Copy link
Contributor

drupol commented Feb 11, 2025

Let me check this out asap.

@drupol
Copy link
Contributor

drupol commented Feb 12, 2025

Looks like it works ☺️

@norberttech
Copy link
Member Author

Looks like it works ☺️

like a charm! Now just need to go through all the new things you introduced and try to understand them 😁 Looks much better than was I had before, thank you!

@drupol
Copy link
Contributor

drupol commented Feb 12, 2025

Hit me if you're blocked, I'll do my best to help.

@github-actions github-actions bot added size: M and removed size: S labels Feb 12, 2025
@norberttech
Copy link
Member Author

norberttech commented Feb 12, 2025

Added starship configuration (that can be overwritten on a repo level)

image

@drupol
Copy link
Contributor

drupol commented Feb 12, 2025

Cool and fancy stuff, but 1GB for a development shell is way too big for me... but it's up to you.

❯ nix build .#devShells.x86_64-linux.default -o result
❯ ll result
lrwxrwxrwx - pol 12 fév 23:27 result -> /nix/store/gj0k7r4vi7aamlplgjkmr0b1prv0j6ba-nix-shell
❯ nix path-info -Sh ./result
/nix/store/gj0k7r4vi7aamlplgjkmr0b1prv0j6ba-nix-shell   1000.5 MiB

@norberttech
Copy link
Member Author

oh I think its the other software I added, will take a look on the size later and remove few things, you are right, 1gb its a bit too much 😅 thanks!

@drupol
Copy link
Contributor

drupol commented Feb 12, 2025

With experience, the lesser the better when it comes to development shells.

@norberttech
Copy link
Member Author

@drupol, are there any best practices around allowing developers to extend the development shell according to their needs? I'm going to remove that tooling as you recommended, but I wonder if there is a way to let people locally add stuff if they want without committing any changes.
Or maybe I should take a similar approach to what I did with starship.toml.dist?
Or maybe its best to keep it minimalistic, with only essential software and personal preferences should come from the operating system?

@norberttech
Copy link
Member Author

heh after removing everything except php and those 4 extensions it's still 1Gb 😅 but I think I'm fine with that, it's not meant for all users, not even for most of the users

@norberttech norberttech force-pushed the 1467-add-nix-to-provide-better-local-development-environment branch from cbdfccf to 8e683f7 Compare February 22, 2025 22:55
@norberttech norberttech merged commit eb244da into flow-php:1.x Feb 23, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants