Compare commits

...
Sign in to create a new pull request.

4 commits

Author SHA1 Message Date
Elec3137
d0df1a198b try to use generate script
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'.
2026-02-01 17:12:26 -08:00
Elec3137
cc050f62fc dubious (mostly style) changes in flake 2026-02-01 14:25:45 -08:00
Elec3137
f72c59f79d rename fromYAML -> importYAML
this is more consistent with existing nixpkgs.lib functions
2026-02-01 14:15:44 -08:00
Elec3137
32393f12c0 add packages.default flake output
this likely doesn't work (yet),
cannot properly test because at time of writing,
the app doesn't compile through `flutter run` either.
2026-02-01 13:39:16 -08:00

View file

@ -29,6 +29,22 @@
... ...
}: }:
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 { _module.args.pkgs = import nixpkgs {
inherit system; inherit system;
@ -45,20 +61,35 @@
olm olm
git git
clang clang
(flutter.override { extraPkgConfigPackages = [ pkgs.libsecret ]; }) usedFlutter
(pkgs.writeShellScriptBin "rustup" (builtins.readFile ./nix/fake-rustup.sh)) (pkgs.writeShellScriptBin "rustup" (builtins.readFile ./nix/fake-rustup.sh))
]; ];
env = { env = {
LD_LIBRARY_PATH = "${ LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}:./build/native_assets/linux";
pkgs.lib.makeLibraryPath ([
pkgs.sqlite
])
}:./build/native_assets/linux";
CPATH = lib.makeSearchPath "include" [ pkgs.glibc.dev ]; 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
'';
};
}; };
}; };
} }