2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2021-07-21 07:28:18 +00:00
|
|
|
, meson, ninja, pkg-config, wayland-scanner, scdoc, makeWrapper
|
2023-08-04 22:07:22 +00:00
|
|
|
, wlroots, wayland, wayland-protocols, pixman, libxkbcommon, xcbutilwm
|
2021-04-26 19:14:03 +00:00
|
|
|
, systemd, libGL, libX11, mesa
|
2020-04-24 23:36:52 +00:00
|
|
|
, xwayland ? null
|
2020-07-18 16:06:22 +00:00
|
|
|
, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-07-18 16:06:22 +00:00
|
|
|
pname = "cage";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "0.1.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Hjdskes";
|
|
|
|
repo = "cage";
|
2020-07-18 16:06:22 +00:00
|
|
|
rev = "v${version}";
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-Suq14YRw/MReDRvO/TQqjpZvpzAEDnHUyVbQj0BPT4c=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
depsBuildBuild = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
nativeBuildInputs = [ meson ninja pkg-config wayland-scanner scdoc makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2023-08-04 22:07:22 +00:00
|
|
|
wlroots wayland wayland-protocols pixman libxkbcommon xcbutilwm
|
2021-04-26 19:14:03 +00:00
|
|
|
mesa # for libEGL headers
|
2020-04-24 23:36:52 +00:00
|
|
|
systemd libGL libX11
|
|
|
|
];
|
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
mesonFlags = [ "-Dxwayland=${lib.boolToString (xwayland != null)}" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
postFixup = lib.optionalString (xwayland != null) ''
|
2020-04-24 23:36:52 +00:00
|
|
|
wrapProgram $out/bin/cage --prefix PATH : "${xwayland}/bin"
|
|
|
|
'';
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
# Tests Cage using the NixOS module by launching xterm:
|
|
|
|
passthru.tests.basic-nixos-module-functionality = nixosTests.cage;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-07-18 16:06:22 +00:00
|
|
|
description = "A Wayland kiosk that runs a single, maximized application";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.hjdskes.nl/projects/cage/";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ primeos ];
|
2023-08-04 22:07:22 +00:00
|
|
|
mainProgram = "cage";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|