nixpkgs/pkgs/applications/window-managers/cage/default.nix

49 lines
1.3 KiB
Nix
Raw Normal View History

2020-07-17 14:21:44 +01:00
{ stdenv, fetchFromGitHub
, meson, ninja, pkg-config, wayland, scdoc, makeWrapper
, wlroots, wayland-protocols, pixman, libxkbcommon
, systemd, libGL, libX11
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";
version = "0.1.2.1";
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}";
sha256 = "1i4rm3dpmk7gkl6hfs6a7vwz76ba7yqcdp63nlrdbnq81m9cy2am";
2019-08-28 21:46:51 +01:00
};
2020-07-17 14:21:44 +01:00
postPatch = ''
substituteInPlace meson.build --replace \
"0.1.2" "${version}"
'';
nativeBuildInputs = [ meson ninja pkg-config wayland scdoc makeWrapper ];
2019-08-28 21:46:51 +01:00
buildInputs = [
wlroots wayland wayland-protocols pixman libxkbcommon
systemd libGL libX11
2019-08-28 21:46:51 +01:00
];
mesonFlags = [ "-Dxwayland=${stdenv.lib.boolToString (xwayland != null)}" ];
postFixup = stdenv.lib.optionalString (xwayland != null) ''
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;
2019-08-28 21:46:51 +01:00
meta = with stdenv.lib; {
2020-07-17 14:21:44 +01:00
description = "A Wayland kiosk that runs a single, maximized application";
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 ];
};
}