aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
blob: 3626549594b1468cf5f09df637e7521e6233623a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
  inputs = {
    flake-utils.url = "github:numtide/flake-utils";
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
  };

  outputs = { self, nixpkgs, flake-utils, ... }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs { inherit system; config.allowUnsupportedSystem = true; };

        myPkgs = with pkgs; {
          libuv = pkgsStatic.libuv;
          luajit = pkgsStatic.luajit;
          qt = qt6; # pkgsStatic.qt6
          lua-libluv = lua-libluv;
        };

        lua-libluv = pkgs.callPackage (import ./nix/libluv.nix) {
          inherit (myPkgs) libuv luajit;
        };

        dependencies = [
          myPkgs.qt.qtbase
          myPkgs.qt.qtwebengine
          myPkgs.luajit
          myPkgs.libuv
          myPkgs.lua-libluv
        ];
      in {
        devShells.default = pkgs.mkShell rec {
          buildInputs = with pkgs; [
            cmake
            gnumake
            clang-tools
            pkg-config
            gdb
            valgrind
          ] ++ dependencies;

          nativeBuildInputs = with pkgs; [gobject-introspection];

          LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath buildInputs}";
          FOOBARITY = "${lua-libluv}";
        };

        packages.default = pkgs.stdenv.mkDerivation {
          pname = "null-browser";
          version = "0.0.0";
          src = ./.;

          buildInputs = [
            myPkgs.qt.qtbase
          ] ++ dependencies;

          NIX_CFLAGS_COMPILE = "-DRELEASE=1";

          nativeBuildInputs = with pkgs; [
            cmake
            myPkgs.qt.wrapQtAppsHook
            pkg-config
          ];
        };
      });
}