2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2020-07-17 14:21:44 +01:00
|
|
|
, meson, ninja, pkg-config, wayland, scdoc, makeWrapper
|
|
|
|
, wlroots, wayland-protocols, pixman, libxkbcommon
|
2021-04-09 09:46:14 +01:00
|
|
|
, systemd, libGL, libX11, mesa
|
2019-08-28 21:46:51 +01:00
|
|
|
, xwayland ? null
|
2020-07-17 14:21:44 +01:00
|
|
|
, nixosTests
|
2019-08-28 21:46:51 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-07-17 14:21:44 +01:00
|
|
|
pname = "cage";
|
2021-04-16 14:12:15 +01:00
|
|
|
version = "0.1.3";
|
2019-08-28 21:46:51 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Hjdskes";
|
2020-01-22 20:15:24 +00:00
|
|
|
repo = "cage";
|
2020-07-17 14:21:44 +01:00
|
|
|
rev = "v${version}";
|
2021-04-16 14:12:15 +01:00
|
|
|
sha256 = "0ixl45g0m8b75gvbjm3gf5qg0yplspgs0xpm2619wn5sygc47sb1";
|
2019-08-28 21:46:51 +01:00
|
|
|
};
|
|
|
|
|
2021-06-23 13:41:18 +01:00
|
|
|
patches = [
|
|
|
|
# To fix the build with wlroots 0.14.0:
|
|
|
|
./wlroots-0_14.patch
|
|
|
|
];
|
|
|
|
|
2020-07-17 14:21:44 +01:00
|
|
|
nativeBuildInputs = [ meson ninja pkg-config wayland scdoc makeWrapper ];
|
2019-08-28 21:46:51 +01:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
wlroots wayland wayland-protocols pixman libxkbcommon
|
2021-04-09 09:46:14 +01:00
|
|
|
mesa # for libEGL headers
|
2019-11-23 17:18:19 +00:00
|
|
|
systemd libGL libX11
|
2019-08-28 21:46:51 +01:00
|
|
|
];
|
|
|
|
|
2021-01-15 13:21:58 +00:00
|
|
|
mesonFlags = [ "-Dxwayland=${lib.boolToString (xwayland != null)}" ];
|
2019-08-28 21:46:51 +01:00
|
|
|
|
2021-01-15 13:21:58 +00:00
|
|
|
postFixup = lib.optionalString (xwayland != null) ''
|
2019-08-28 21:46:51 +01:00
|
|
|
wrapProgram $out/bin/cage --prefix PATH : "${xwayland}/bin"
|
|
|
|
'';
|
|
|
|
|
2020-07-17 14:21:44 +01:00
|
|
|
# Tests Cage using the NixOS module by launching xterm:
|
|
|
|
passthru.tests.basic-nixos-module-functionality = nixosTests.cage;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-07-17 14:21:44 +01:00
|
|
|
description = "A Wayland kiosk that runs a single, maximized application";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.hjdskes.nl/projects/cage/";
|
2019-08-28 21:46:51 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ primeos ];
|
|
|
|
};
|
|
|
|
}
|