Files
oott/nix/package.nix
T

82 lines
2.1 KiB
Nix
Raw Normal View History

2026-02-12 10:44:58 -05:00
# {
# lib,
# pkgs,
# }: let
# oott-backend = pkgs.rustPlatform.buildRustPackage rec {
# pname = "oott-backend";
# version = "0.0.1";
# src = ./../backend;
# cargoLock = {
# lockFile = ./../backend/Cargo.lock;
# };
# nativeBuildInputs = [pkgs.pkg-config];
# PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
# };
# oott-frontend = pkgs.flutter.buildFlutterApplication rec {
# pname = "oott-frontend";
# version = "0.0.1";
# src = ./../frontend;
# pubspecLock = lib.importJSON ./../frontend/pubspec.lock.json;
# # We need to create the pubspec.lock.json file beforehand, for now we do it manually before releasing a new version by
# # cat pubspec.lock | nix run nixpkgs#yj > pubspec.lock.json
# # buildInputs = [pkgs.yj];
# # preBuild = ''
# # cat $src/pubspec.lock | yj > $src/pubspec.lock.json
# # '';
# };
# in
# pkgs.stdenv.mkDerivation {
# name = "oott";
# buildInputs = [oott-frontend oott-backend];
# src = ./../extras;
# installPhase = ''
# mkdir -p $out/bin
# cp ${oott-backend}/bin/* $out/bin/
# '';
# }
2026-02-12 09:31:35 -05:00
{
lib,
pkgs,
}: let
2026-02-12 10:44:58 -05:00
oott-frontend = pkgs.stdenv.mkDerivation {
name = "oott-frontend";
2026-02-12 09:31:35 -05:00
version = "0.0.1";
src = ./../frontend;
2026-02-12 10:44:58 -05:00
doCheck = false;
dontFixup = true;
2026-02-12 09:31:35 -05:00
2026-02-12 10:44:58 -05:00
nativeBuildInputs = [pkgs.cacert pkgs.wget];
buildInputs = [pkgs.flutter];
buildPhase = ''
runHook preBuild
mkdir -p $out/web
# pwd
# ls -la
# HOME=$out flutter build web -o $out/web/ --verbose --disable-analytics
# ls -la $out/web
HOME=$out flutter doctor
echo "done3"
runHook postBuild
2026-02-12 09:31:35 -05:00
'';
2026-02-12 10:44:58 -05:00
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "sha256-p/tQCa0AvRHUGYiqdsILo0AEFOvXC4ZBtp8cMDv5hI0=";
# outputHash = pkgs.lib.fakeHash;
2026-02-12 09:31:35 -05:00
};
in
pkgs.stdenv.mkDerivation {
name = "oott";
2026-02-12 10:44:58 -05:00
buildInputs = [oott-frontend];
2026-02-12 09:03:10 -05:00
src = ./../extras;
installPhase = ''
2026-02-12 09:31:35 -05:00
mkdir -p $out/bin
2026-02-12 10:44:58 -05:00
mkdir -p $out/web
ls -la ${oott-frontend}
ls -la ${oott-frontend}/web
cp -r ${oott-frontend}/web/* $out/web/
'';
}