forked from Henry-Hiles/nexus
the script fails with: Couldn't resolve the package 'ffigen' in 'package:ffigen/ffigen.dart'. Couldn't resolve the package 'path' in 'package:path/path.dart'.
95 lines
2.7 KiB
Nix
95 lines
2.7 KiB
Nix
{
|
|
description = "Nexus Flutter Flake";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
flake-parts,
|
|
nixpkgs,
|
|
self,
|
|
...
|
|
}@inputs:
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
systems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"aarch64-darwin"
|
|
"x86_64-darwin"
|
|
];
|
|
|
|
perSystem =
|
|
{
|
|
lib,
|
|
pkgs,
|
|
system,
|
|
...
|
|
}:
|
|
|
|
let
|
|
src = ./.;
|
|
|
|
# from https://discourse.nixos.org/t/is-there-a-way-to-read-a-yaml-file-and-get-back-a-set/18385/5
|
|
importYAML =
|
|
file:
|
|
lib.importJSON (
|
|
pkgs.runCommand "converted-yaml.json" { } ''${pkgs.yj}/bin/yj < "${file}" > "$out"''
|
|
);
|
|
|
|
package = importYAML "${src}/pubspec.yaml";
|
|
|
|
usedFlutter = (pkgs.flutter.override { extraPkgConfigPackages = [ pkgs.libsecret ]; });
|
|
|
|
buildInputs = [ pkgs.sqlite ];
|
|
in
|
|
{
|
|
_module.args.pkgs = import nixpkgs {
|
|
inherit system;
|
|
config = {
|
|
permittedInsecurePackages = [ "olm-3.2.16" ];
|
|
android_sdk.accept_license = true;
|
|
allowUnfree = true;
|
|
};
|
|
};
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
packages = with pkgs; [
|
|
go
|
|
olm
|
|
git
|
|
clang
|
|
usedFlutter
|
|
|
|
(pkgs.writeShellScriptBin "rustup" (builtins.readFile ./nix/fake-rustup.sh))
|
|
];
|
|
|
|
env = {
|
|
LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}:./build/native_assets/linux";
|
|
CPATH = lib.makeSearchPath "include" [ pkgs.glibc.dev ];
|
|
};
|
|
};
|
|
|
|
packages.default = usedFlutter.buildFlutterApplication {
|
|
inherit src buildInputs;
|
|
pname = package.name;
|
|
version = package.version;
|
|
|
|
pubspecLock = importYAML "${src}/pubspec.lock";
|
|
gitHashes = {
|
|
flutter_chat_ui = "sha256-4fuag7lRH5cMBFD3fUzj2K541JwXLoz8HF/4OMr3uhk=";
|
|
flutter_link_previewer = "sha256-4fuag7lRH5cMBFD3fUzj2K541JwXLoz8HF/4OMr3uhk=";
|
|
flyer_chat_text_message = "sha256-4fuag7lRH5cMBFD3fUzj2K541JwXLoz8HF/4OMr3uhk=";
|
|
window_size = "sha256-XelNtp7tpZ91QCEcvewVphNUtgQX7xrp5QP0oFo6DgM=";
|
|
};
|
|
|
|
patchPhase = /* sh */ ''
|
|
patchShebangs ./scripts/generate.sh
|
|
./scripts/generate.sh # note: this doesn't quit the build on fail
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|