add nix package
This commit is contained in:
parent
b407bbfdee
commit
11ecec5ab3
5 changed files with 65 additions and 23 deletions
36
linux/nix/pkg/default.nix
Normal file
36
linux/nix/pkg/default.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
lib,
|
||||
callPackage,
|
||||
libclang,
|
||||
flutter,
|
||||
src,
|
||||
}:
|
||||
|
||||
flutter.buildFlutterApplication {
|
||||
pname = "nexus";
|
||||
version = "0.1.0";
|
||||
inherit src;
|
||||
|
||||
preBuild = ''
|
||||
cp ${callPackage ./gomuks.nix { inherit src; }}/lib/* .
|
||||
packageRunCustom nexus generate source/scripts test
|
||||
packageRun build_runner build
|
||||
'';
|
||||
|
||||
env.LIBCLANG_PATH = lib.makeLibraryPath [ libclang ];
|
||||
|
||||
autoPubspecLock = src + "/pubspec.lock";
|
||||
|
||||
gitHashes = {
|
||||
window_size = "sha256-XelNtp7tpZ91QCEcvewVphNUtgQX7xrp5QP0oFo6DgM=";
|
||||
flutter_chat_ui = "sha256-4fuag7lRH5cMBFD3fUzj2K541JwXLoz8HF/4OMr3uhk=";
|
||||
flutter_link_previewer = "sha256-4fuag7lRH5cMBFD3fUzj2K541JwXLoz8HF/4OMr3uhk=";
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "A simple and user-friendly Matrix client";
|
||||
mainProgram = "nexus";
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = with lib.maintainers; [ quadradical ];
|
||||
};
|
||||
}
|
||||
31
linux/nix/pkg/gomuks.nix
Normal file
31
linux/nix/pkg/gomuks.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
src,
|
||||
buildGoModule,
|
||||
}:
|
||||
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "gomuks-ffi";
|
||||
version = "submodule";
|
||||
|
||||
doCheck = false;
|
||||
|
||||
src = "${src}/gomuks";
|
||||
|
||||
vendorHash = "sha256-zBDfBZqUoHIfZ0AajZEvSBbskjpFB7yIsomt0KYDo7Y=";
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
go build -buildmode=c-shared -o libgomuks.so -tags goolm,noheic ./pkg/ffi
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -D --mode=0644 libgomuks.so --target-directory $out/lib
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue