depot/third_party/nixpkgs/pkgs/applications/window-managers/cage/default.nix
Default email 9405df4a82 Project import generated by Copybara.
GitOrigin-RevId: 8e4fe32876ca15e3d5eb3ecd3ca0b224417f5f17
2021-04-26 15:14:03 -04:00

49 lines
1.3 KiB
Nix

{ lib, stdenv, fetchFromGitHub
, meson, ninja, pkg-config, wayland, scdoc, makeWrapper
, wlroots, wayland-protocols, pixman, libxkbcommon
, systemd, libGL, libX11, mesa
, xwayland ? null
, nixosTests
}:
stdenv.mkDerivation rec {
pname = "cage";
version = "0.1.2.1";
src = fetchFromGitHub {
owner = "Hjdskes";
repo = "cage";
rev = "v${version}";
sha256 = "1i4rm3dpmk7gkl6hfs6a7vwz76ba7yqcdp63nlrdbnq81m9cy2am";
};
postPatch = ''
substituteInPlace meson.build --replace \
"0.1.2" "${version}"
'';
nativeBuildInputs = [ meson ninja pkg-config wayland scdoc makeWrapper ];
buildInputs = [
wlroots wayland wayland-protocols pixman libxkbcommon
mesa # for libEGL headers
systemd libGL libX11
];
mesonFlags = [ "-Dxwayland=${lib.boolToString (xwayland != null)}" ];
postFixup = lib.optionalString (xwayland != null) ''
wrapProgram $out/bin/cage --prefix PATH : "${xwayland}/bin"
'';
# Tests Cage using the NixOS module by launching xterm:
passthru.tests.basic-nixos-module-functionality = nixosTests.cage;
meta = with lib; {
description = "A Wayland kiosk that runs a single, maximized application";
homepage = "https://www.hjdskes.nl/projects/cage/";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ primeos ];
};
}