summaryrefslogtreecommitdiff
path: root/flake.nix
blob: 8edaccbc0ce6fa48c572e37f390b4f7b5539896e (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
66
67
68
69
70
71
72
73
74
{
  description = "OpenCut Classic development shell";

  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

  outputs =
    { nixpkgs, ... }:
    let
      systems = [
        "x86_64-linux"
        "aarch64-linux"
        "aarch64-darwin"
      ];
      forEachSystem = nixpkgs.lib.genAttrs systems;
    in
    {
      devShells = forEachSystem (
        system:
        let
          pkgs = import nixpkgs { inherit system; };
        in
        {
          default = pkgs.mkShell {
            packages = with pkgs; [
              bun
              just
              nodejs

              cargo
              clippy
              rustc
              rustfmt

              cmake
              pkg-config

              alsa-lib
              fontconfig
              freetype
              libxkbcommon
              openssl
              vulkan-loader
              wayland
              libX11
              libxcb

              ffmpeg-headless.dev
              llvmPackages.libclang
            ];

            env.LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";

            shellHook = ''
              export BINDGEN_EXTRA_CLANG_ARGS="$(cat ${pkgs.stdenv.cc}/nix-support/cc-cflags 2>/dev/null) $(cat ${pkgs.stdenv.cc}/nix-support/libc-cflags 2>/dev/null) $BINDGEN_EXTRA_CLANG_ARGS"
              export LD_LIBRARY_PATH=${
                pkgs.lib.makeLibraryPath (
                  with pkgs; [
                    alsa-lib
                    fontconfig
                    freetype
                    libxkbcommon
                    vulkan-loader
                    wayland
                    libX11
                    libxcb
                  ]
                )
              }:$LD_LIBRARY_PATH
            '';
          };
        }
      );
    };
}