Hi,
I don’t understand how I shall setup a flutter development environment using nix.
I am running on an Apple-M-Processor (system = “aarch64-darwin”) and have a system-wide nix setup, using flakes and home-manager.
I started with my Mac from scratch and so far installed & configured everything using Nix (a global profile).
I started adding flutter dependencies, mainly the Android SDK, to this configuration. I wanted to have all configuration in a separate file, flutter.nix. Doing so I got the impression, that the way described in the nix wiki (Nixpkgs Reference Manual) doesn’t work - seems like aarch64-darwin is not supported (at least that was the error message where I stopped). So I used android-nixpkgs (GitHub - tadfisher/android-nixpkgs: Nix-packaged Android SDK). But strangely nothing got installed, not did I get any error message.
After digging deep in the web, I got the impression that I am doing it wrong - and that I am supposed to configure this project specific. While I am the only developer, using only one machine, I want to have a reproducible setup. And binding this to the project makes sense - even though I am working on only one project right now - I might want to reproduce its state at a specific time in the future … ok.
But how to do that? I trieft to use the setup from android-nixpgks with flakes and home-manager, with aa flake.nix in the project’s root. But nix develop complains, that my flake “does not provide attribute ‘devShells.aarch64-darwin.default’, ‘devShell.aarch64-darwin’, ‘packages.aarch64-darwin.default’ or ‘defaultPackage.aarch64-darwin’” … and googling for that suggest to re-install nix!
So, here is my confusion, and my ask for help (and many thanks for reading so far!):
How can I setup a flake.nix for flutter development with codium the most pragmatic way?
What do I have to use, given my setup? E.g. home-manager? Or is that optional? Can I inherit from my global nix profile, like the currentSystem? Or is it better and not much of an overhead to use flakeUtils?
I want to keep it as simple as possible (and hope that the answer will help others like me ):
- use a flake, as I am using flakes in my global setup as well
- using the “standard” way of installing the android sdk, which works for aarch64-darwin
- install emulator and profiles via nix, so that I don’t have to install android-studio
Many thanks!