Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 stdenv, 4 source, # this is ./source.nix 5 6 glib, 7 wrapGAppsHook3, 8 gobject-introspection, 9 meson, 10 pkg-config, 11 ninja, 12 vala, 13 wayland, 14 wayland-scanner, 15 python3, 16}: 17let 18 cleanArgs = lib.flip builtins.removeAttrs [ 19 "name" 20 "sourceRoot" 21 "nativeBuildInputs" 22 "buildInputs" 23 "website-path" 24 "meta" 25 ]; 26 27 buildAstalModule = 28 { 29 name, 30 sourceRoot ? "lib/${name}", 31 nativeBuildInputs ? [ ], 32 buildInputs ? [ ], 33 website-path ? name, 34 meta ? { }, 35 ... 36 }@args: 37 stdenv.mkDerivation ( 38 finalAttrs: 39 cleanArgs args 40 // { 41 pname = "astal-${name}"; 42 inherit (source) version; 43 44 __structuredAttrs = true; 45 strictDeps = true; 46 47 src = source; 48 49 sourceRoot = "${finalAttrs.src.name}/${sourceRoot}"; 50 51 nativeBuildInputs = nativeBuildInputs ++ [ 52 wrapGAppsHook3 53 gobject-introspection 54 meson 55 pkg-config 56 ninja 57 vala 58 wayland 59 wayland-scanner 60 python3 61 ]; 62 63 buildInputs = [ glib ] ++ buildInputs; 64 65 meta = { 66 homepage = "https://aylur.github.io/astal/guide/libraries/${website-path}"; 67 license = lib.licenses.lgpl21; 68 maintainers = with lib.maintainers; [ perchun ]; 69 platforms = [ 70 "aarch64-linux" 71 "x86_64-linux" 72 ]; 73 } 74 // meta; 75 } 76 ); 77in 78 79args: 80# to support (finalAttrs: {...}) 81if builtins.typeOf args == "function" then 82 buildAstalModule (lib.fix args) 83else 84 buildAstalModule args