1{
2 lib,
3 callPackage,
4 runCommand,
5 layer-shell-qt,
6 qtwayland,
7 wrapQtAppsHook,
8 unwrapped ? callPackage ./unwrapped.nix { },
9 withWayland ? false,
10 withLayerShellQt ? false,
11 extraPackages ? [ ],
12}:
13runCommand "sddm-wrapped"
14 {
15 inherit (unwrapped) version;
16
17 buildInputs =
18 unwrapped.buildInputs
19 ++ extraPackages
20 ++ lib.optional withWayland qtwayland
21 ++ lib.optional (withWayland && withLayerShellQt) layer-shell-qt;
22 nativeBuildInputs = [ wrapQtAppsHook ];
23
24 strictDeps = true;
25
26 passthru = {
27 inherit unwrapped;
28 inherit (unwrapped.passthru) tests;
29 };
30
31 meta = unwrapped.meta;
32 }
33 ''
34 mkdir -p $out/bin
35
36 cd ${unwrapped}
37
38 for i in *; do
39 if [ "$i" == "bin" ]; then
40 continue
41 fi
42 ln -s ${unwrapped}/$i $out/$i
43 done
44
45 for i in bin/*; do
46 makeQtWrapper ${unwrapped}/$i $out/$i --set SDDM_GREETER_DIR $out/bin
47 done
48 ''