2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2020-07-18 16:06:22 +00:00
|
|
|
, meson, ninja, pkg-config, wayland, scdoc, makeWrapper
|
|
|
|
, wlroots, wayland-protocols, pixman, libxkbcommon
|
2020-04-24 23:36:52 +00:00
|
|
|
, systemd, libGL, libX11
|
|
|
|
, 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";
|
|
|
|
version = "0.1.2.1";
|
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}";
|
|
|
|
sha256 = "1i4rm3dpmk7gkl6hfs6a7vwz76ba7yqcdp63nlrdbnq81m9cy2am";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace meson.build --replace \
|
|
|
|
"0.1.2" "${version}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ meson ninja pkg-config wayland scdoc makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
wlroots wayland wayland-protocols pixman libxkbcommon
|
|
|
|
systemd libGL libX11
|
|
|
|
];
|
|
|
|
|
|
|
|
mesonFlags = [ "-Dxwayland=${stdenv.lib.boolToString (xwayland != null)}" ];
|
|
|
|
|
|
|
|
postFixup = stdenv.lib.optionalString (xwayland != null) ''
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|