Skip to content

Conversation

@vikingnope
Copy link
Contributor

@vikingnope vikingnope commented Nov 24, 2025

Pull Request Description

This pull request adds comprehensive Nix support for the project, introducing a Nix flake for reproducible builds, a development shell, and automation for updating dependency hashes. The changes enable easier development and packaging on Nix-based systems, automate hash management for dependencies, and improve the developer onboarding experience.

Nix Flake and Build Infrastructure:

  • Added a new flake.nix file that defines the project as a Nix flake, specifying package builds, dependency pinning, and custom source builders for media_kit and related plugins. This allows reproducible and declarative builds of the Flutter application on NixOS and compatible systems.
  • Introduced custom Nix derivations for the fvp plugin (nix/fvp.nix) and media_kit_libs_linux (nix/media_kit_libs_linux_donutware.nix), ensuring all required native dependencies are fetched and built in a fully reproducible manner.

Development Environment:

  • Added a shell.nix file that sets up a complete development environment with all necessary build tools, libraries, and environment variables for Flutter and Linux desktop development. This streamlines onboarding and ensures consistency across developer machines.
  • Updated .envrc to automatically use the flake-based environment if Nix is installed, improving developer experience for those using direnv.

Automation and CI:

  • Added a GitHub Actions workflow (.github/workflows/update-nix-hashes.yml) that automatically updates Nix hashes for media_kit when pubspec.lock changes, and creates a pull request with the updated hashes. This reduces manual maintenance and keeps builds reproducible.

Issue Being Fixed

N/A

Screenshots / Recordings

Checklist

  • If a new package was added, did you ensure it works for all supported platforms? Is the package well maintained
  • Check that any changes are related to the issue at hand.

@vikingnope vikingnope changed the title added flake and .envrc chore: Nix Development Experience Nov 24, 2025
@vikingnope vikingnope changed the title chore: Nix Development Experience chore: Nix development experience Nov 24, 2025
@vikingnope vikingnope changed the title chore: Nix development experience chore: Nix flake Nov 30, 2025
@vikingnope vikingnope marked this pull request as draft November 30, 2025 10:07
@vikingnope
Copy link
Contributor Author

I am going to make some changes so that people can use this within their flake.nix.

Sorry I am still getting used to the whole system 😅

@vikingnope vikingnope marked this pull request as ready for review December 21, 2025 20:42
@vikingnope
Copy link
Contributor Author

I had to do some workarounds for fvp (specifically mdk-sdk, I believe there was a discussion to remove this #500), and mimalloc which were not getting fetched automatically

@vikingnope vikingnope changed the title chore: Nix flake feat: Nix support for reproducible builds and dev shell Dec 22, 2025
@PartyDonut
Copy link
Collaborator

Sorry for the late response.

While I appreciate the implementation and can only assume it works for using this on nix. This would probably only satisfy a small community, but would require a quite a bit of up-keep. Especially given that I have no way of testing it.

Probably better to keep specific install instructions like this in a separate repository.

@PartyDonut PartyDonut closed this Jan 18, 2026
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.

2 participants