2024-01-10 22:43:46 -08:00
|
|
|
# This flake file is community maintained
|
|
|
|
{
|
|
|
|
description = "Niri: A scrollable-tiling Wayland compositor.";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
2024-09-15 14:52:28 +02:00
|
|
|
crane.url = "github:ipetkov/crane";
|
2024-01-10 22:43:46 -08:00
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
nix-filter.url = "github:numtide/nix-filter";
|
|
|
|
fenix = {
|
|
|
|
url = "github:nix-community/fenix/monthly";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-09-27 12:42:44 -04:00
|
|
|
outputs =
|
|
|
|
{
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
|
|
|
crane,
|
|
|
|
nix-filter,
|
|
|
|
flake-utils,
|
|
|
|
fenix,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
systems = [
|
|
|
|
"aarch64-linux"
|
|
|
|
"x86_64-linux"
|
|
|
|
];
|
|
|
|
in
|
2024-01-10 22:43:46 -08:00
|
|
|
flake-utils.lib.eachSystem systems (
|
2024-09-27 12:42:44 -04:00
|
|
|
system:
|
|
|
|
let
|
2024-01-10 22:43:46 -08:00
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
toolchain = fenix.packages.${system}.complete.toolchain;
|
2024-08-08 19:53:36 +02:00
|
|
|
craneLib = (crane.mkLib pkgs).overrideToolchain toolchain;
|
2024-01-10 22:43:46 -08:00
|
|
|
|
|
|
|
craneArgs = {
|
|
|
|
pname = "niri";
|
|
|
|
version = self.rev or "dirty";
|
|
|
|
|
2024-02-10 18:10:35 +01:00
|
|
|
src = nixpkgs.lib.cleanSourceWith {
|
|
|
|
src = craneLib.path ./.;
|
2024-09-27 12:42:44 -04:00
|
|
|
filter =
|
|
|
|
path: type:
|
2024-08-24 23:40:08 +02:00
|
|
|
(builtins.match "resources" path == null)
|
2024-09-27 12:42:44 -04:00
|
|
|
|| ((craneLib.filterCargoSources path type) && (builtins.match "niri-visual-tests" path == null));
|
2024-01-10 22:43:46 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
pkg-config
|
|
|
|
autoPatchelfHook
|
|
|
|
clang
|
2024-03-01 12:50:49 +01:00
|
|
|
gdk-pixbuf
|
|
|
|
graphene
|
|
|
|
gtk4
|
|
|
|
libadwaita
|
2024-01-10 22:43:46 -08:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
wayland
|
|
|
|
systemd # For libudev
|
|
|
|
seatd # For libseat
|
|
|
|
libxkbcommon
|
2024-09-04 18:27:05 +02:00
|
|
|
libdisplay-info
|
2024-01-10 22:43:46 -08:00
|
|
|
libinput
|
|
|
|
mesa # For libgbm
|
|
|
|
fontconfig
|
|
|
|
stdenv.cc.cc.lib
|
|
|
|
pipewire
|
2024-01-18 11:15:48 +04:00
|
|
|
pango
|
2024-08-24 23:40:08 +02:00
|
|
|
cairo
|
|
|
|
glib
|
|
|
|
pixman
|
2024-01-10 22:43:46 -08:00
|
|
|
];
|
|
|
|
|
|
|
|
runtimeDependencies = with pkgs; [
|
|
|
|
wayland
|
|
|
|
mesa
|
|
|
|
libglvnd # For libEGL
|
2024-04-29 20:40:10 +02:00
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXi
|
2024-07-08 15:13:00 +02:00
|
|
|
libxkbcommon
|
2024-01-10 22:43:46 -08:00
|
|
|
];
|
|
|
|
|
|
|
|
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
|
2024-08-08 19:53:36 +02:00
|
|
|
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath craneArgs.runtimeDependencies; # Needed for tests to find libxkbcommon
|
2024-01-10 22:43:46 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoArtifacts = craneLib.buildDepsOnly craneArgs;
|
2024-09-27 12:42:44 -04:00
|
|
|
niri = craneLib.buildPackage (craneArgs // { inherit cargoArtifacts; });
|
|
|
|
in
|
|
|
|
{
|
2024-09-27 12:42:29 -04:00
|
|
|
formatter = pkgs.nixfmt-rfc-style;
|
2024-01-10 22:43:46 -08:00
|
|
|
|
|
|
|
checks.niri = niri;
|
|
|
|
packages.default = niri;
|
|
|
|
|
2024-08-24 23:40:08 +02:00
|
|
|
devShells.default = craneLib.devShell {
|
2024-09-27 12:42:44 -04:00
|
|
|
inputsFrom = [ niri ];
|
2024-07-08 15:13:00 +02:00
|
|
|
|
2024-09-27 12:42:44 -04:00
|
|
|
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (
|
|
|
|
craneArgs.runtimeDependencies ++ craneArgs.nativeBuildInputs ++ craneArgs.buildInputs
|
|
|
|
);
|
2024-08-24 23:40:08 +02:00
|
|
|
inherit (niri) LIBCLANG_PATH;
|
2024-01-10 22:43:46 -08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|