1{
2 pkgs,
3 lib,
4 stdenvNoCC,
5 themeConfig ? null,
6}:
7
8stdenvNoCC.mkDerivation rec {
9 pname = "sddm-sugar-dark";
10 version = "1.2";
11
12 src = pkgs.fetchFromGitHub {
13 owner = "MarianArlt";
14 repo = "sddm-sugar-dark";
15 rev = "v${version}";
16 hash = "sha256-C3qB9hFUeuT5+Dos2zFj5SyQegnghpoFV9wHvE9VoD8=";
17 };
18
19 dontWrapQtApps = true;
20
21 buildInputs = with pkgs.libsForQt5.qt5; [ qtgraphicaleffects ];
22
23 installPhase =
24 let
25 iniFormat = pkgs.formats.ini { };
26 configFile = iniFormat.generate "" { General = themeConfig; };
27
28 basePath = "$out/share/sddm/themes/sugar-dark";
29 in
30 ''
31 mkdir -p ${basePath}
32 cp -r $src/* ${basePath}
33 ''
34 + lib.optionalString (themeConfig != null) ''
35 ln -sf ${configFile} ${basePath}/theme.conf.user
36 '';
37
38 meta = {
39 description = "Dark SDDM theme from the sugar family";
40 homepage = "https://github.com/${src.owner}/${pname}";
41 license = lib.licenses.gpl3;
42
43 platforms = lib.platforms.linux;
44 maintainers = with lib.maintainers; [ danid3v ];
45 };
46}