mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-02 11:03:57 +00:00
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
49 lines
1.3 KiB
Nix
49 lines
1.3 KiB
Nix
{ lib, stdenv, fetchFromGitHub
|
|
, meson, ninja, pkg-config, wayland, scdoc, makeWrapper
|
|
, wlroots, wayland-protocols, pixman, libxkbcommon
|
|
, systemd, libGL, libX11
|
|
, 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
|
|
systemd libGL libX11
|
|
];
|
|
|
|
mesonFlags = [ "-Dxwayland=${stdenv.lib.boolToString (xwayland != null)}" ];
|
|
|
|
postFixup = stdenv.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 ];
|
|
};
|
|
}
|