This is the smallest complete example in the repo.
It is a plain Flutter Linux app with pinned Guix files and a checked-in release hash, so you can build it and see what a known-good result looks like.
Run these commands from this directory:
dart run ../../packages/guix/bin/guix_dart.dart setup linux
dart run ../../packages/guix/bin/guix_dart.dart build linux
./tool/hash_linux_bundle.sh --checkExpected normalized Linux bundle hash:
6ff79e75e7fdb074f73bfa7c13095db2b6c4b92bdd25b0928d7303b618594d0a
That value is stored in expected-hashes/linux-x86_64.sha256.
It only applies to this app and the pinned toolchain in this directory.
The first command fetches Flutter 3.24.5 into .flutter-sdk/ if it is not
already present. If you also want to pin the Flutter download itself, fill in
the flutter.checksums values in guix.yaml after setup prints them.
If you prefer shorter commands, the same flow is wrapped in make guix-setup,
make guix-build, and make verify-linux.
This is the path shown above. It is handy when you are working in a clone or fork of this repository and do not want to install anything globally.
dart run ../../packages/guix/bin/guix_dart.dart setup linux
dart run ../../packages/guix/bin/guix_dart.dart build linux
./tool/hash_linux_bundle.sh --checkIf you prefer the published CLI, the same example works that way too:
dart pub global activate guix
guix_dart setup linux
guix_dart build linux
./tool/hash_linux_bundle.sh --checkRun those commands from this directory if you want to verify the checked-in example, or from your own project root after you copy over the relevant files.
If you already have a Flutter app and do not want to vendor this repository, copy these files into your app:
guix.yamlguix/channels.scmguix/linux.scmtool/hash_linux_bundle.sh
Then use the installed CLI:
dart pub global activate guix
guix_dart setup linux
guix_dart build linux
./tool/hash_linux_bundle.shAfter your first known-good build, replace
expected-hashes/linux-x86_64.sha256 with a hash from your own app. Once you
change the app code, do not expect it to match the reference hash shown above.
This is the vendored setup described in the main repo README. The layout is a
little different from this example: in a host project, the full repo lives
under guix/.
From your host project root:
git subtree add --prefix=guix https://github.com/ManyMath/guix.git main --squash
bash guix/bootstrap.sh
dart pub global activate guix
make guix-buildIf you use Makefile.inc, add this to your project Makefile:
GUIX_FLUTTER_DIR ?= guix
include $(GUIX_FLUTTER_DIR)/Makefile.incIf you later add a guix.yaml-driven config to that host project, use
make guix-sync to regenerate the .env files from it.
There is also a shell-only path with no Dart dependency. In that mode the repo
uses guix-flutter.conf, flutter_version.env, and
android_sdk_version.env instead of guix.yaml.
From your host project root:
git subtree add --prefix=guix https://github.com/ManyMath/guix.git main --squash
bash guix/bootstrap.sh
$EDITOR flutter_version.env
$EDITOR android_sdk_version.env
make guix-setup
make guix-buildIf you want the same hash check there, copy tool/hash_linux_bundle.sh into
your host project and commit an expected hash for that project's own first
known-good build.
If you start from this example, or any other guix.yaml project, and later
want standalone scripts, use eject once:
dart run ../../packages/guix/bin/guix_dart.dart eject
./scripts/fetch-flutter.sh
make -f Makefile.generated build-linux
./tool/hash_linux_bundle.shThat writes self-contained scripts, .env files, and Makefile.generated,
after which you can stop depending on guix_dart for day-to-day builds.
If you already have a Flutter app, start by copying:
guix.yamlguix/channels.scmguix/linux.scmtool/hash_linux_bundle.sh
Then change platforms.linux.build.command and platforms.linux.build.output
to match your app.
If you would rather start from this repo and swap in your own app, replace:
lib/linux/pubspec.yaml
Keep the Guix files and the hash script in place until your own build is stable.