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

fix: nix flake #119

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
description = "Flutter environment";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs";
};

outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachSystem ["aarch64-linux"] (
system: let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in {
devShell = with pkgs;
mkShell rec {
FLUTTER_ROOT = flutter;
DART_ROOT = "${flutter}/bin/cache/dart-sdk";
QT_QPA_PLATFORM = "wayland;xcb"; # emulator related: try using wayland, otherwise fall back to X
buildInputs = [
flutter
gradle
jdk21
protobuf
buf
pandoc
libsecret.dev
gtk3.dev
grpcurl
glib
pcre2
pkg-config
];
CMAKE_PREFIX_PATH = "${pkgs.lib.makeLibraryPath [libsecret.dev gtk3.dev]}";

# we need shellHook here as $PWD is not available in the nix environment
shellHook = ''
# TODO: feels super hacky, i feel like flutter is messing up somewhere here
# also probably breaks stuff when doing a release build
# we could provide shell scripts for building release/debug for nix users that set the correct dir
export CMAKE_INSTALL_PREFIX=$PWD/frontend/build/linux/arm64/debug/bundle
'';
};
}
);
}
37 changes: 0 additions & 37 deletions shell.nix

This file was deleted.

Loading