81 lines
1.6 KiB
Markdown
81 lines
1.6 KiB
Markdown
# Dependencies
|
|
|
|
Iced requires some system dependencies to work, and not
|
|
all operating systems come with them installed.
|
|
|
|
You can follow the provided instructions for your system to
|
|
get them, if your system isn't here, add it!
|
|
|
|
## NixOS
|
|
|
|
You can add this `shell.nix` to your project and use it by running `nix-shell`:
|
|
|
|
```nix
|
|
{ pkgs ? import <nixpkgs> {} }:
|
|
|
|
pkgs.mkShell rec {
|
|
buildInputs = with pkgs; [
|
|
expat
|
|
fontconfig
|
|
freetype
|
|
freetype.dev
|
|
libGL
|
|
pkg-config
|
|
xorg.libX11
|
|
xorg.libXcursor
|
|
xorg.libXi
|
|
xorg.libXrandr
|
|
wayland
|
|
libxkbcommon
|
|
];
|
|
|
|
LD_LIBRARY_PATH =
|
|
builtins.foldl' (a: b: "${a}:${b}/lib") "${pkgs.vulkan-loader}/lib" buildInputs;
|
|
}
|
|
```
|
|
|
|
Alternatively, you can use this `flake.nix` to create a dev shell, activated by `nix develop`:
|
|
|
|
```nix
|
|
{
|
|
inputs = {
|
|
nixpkgs.url = "nixpkgs/nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = {
|
|
nixpkgs,
|
|
flake-utils,
|
|
...
|
|
}:
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system: let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
};
|
|
|
|
buildInputs = with pkgs; [
|
|
expat
|
|
fontconfig
|
|
freetype
|
|
freetype.dev
|
|
libGL
|
|
pkg-config
|
|
xorg.libX11
|
|
xorg.libXcursor
|
|
xorg.libXi
|
|
xorg.libXrandr
|
|
wayland
|
|
libxkbcommon
|
|
];
|
|
in {
|
|
devShells.default = pkgs.mkShell {
|
|
inherit buildInputs;
|
|
|
|
LD_LIBRARY_PATH =
|
|
builtins.foldl' (a: b: "${a}:${b}/lib") "${pkgs.vulkan-loader}/lib" buildInputs;
|
|
};
|
|
}
|
|
);
|
|
}
|
|
```
|