1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 qtgraphicaleffects,
6 themeConfig ? { },
7}:
8let
9 customToString = x: if builtins.isBool x then lib.boolToString x else toString x;
10 configLines = lib.mapAttrsToList (name: value: lib.nameValuePair name value) themeConfig;
11 configureTheme =
12 "cp theme.conf theme.conf.orig \n"
13 + (lib.concatMapStringsSep "\n" (
14 configLine:
15 "grep -q '^${configLine.name}=' theme.conf || echo '${configLine.name}=' >> \"$1\"\n"
16 + "sed -i -e 's/^${configLine.name}=.*$/${configLine.name}=${
17 lib.escape [ "/" "&" "\\" ] (customToString configLine.value)
18 }/' theme.conf"
19 ) configLines);
20in
21stdenv.mkDerivation {
22 pname = "sddm-chili-theme";
23 version = "0.1.5";
24
25 src = fetchFromGitHub {
26 owner = "MarianArlt";
27 repo = "sddm-chili";
28 rev = "6516d50176c3b34df29003726ef9708813d06271";
29 sha256 = "036fxsa7m8ymmp3p40z671z163y6fcsa9a641lrxdrw225ssq5f3";
30 };
31
32 propagatedBuildInputs = [
33 qtgraphicaleffects
34 ];
35
36 dontWrapQtApps = true;
37
38 preInstall = configureTheme;
39
40 postInstall = ''
41 mkdir -p $out/share/sddm/themes/chili
42
43 mv * $out/share/sddm/themes/chili/
44 '';
45
46 postFixup = ''
47 mkdir -p $out/nix-support
48
49 echo ${qtgraphicaleffects} >> $out/nix-support/propagated-user-env-packages
50 '';
51 meta = with lib; {
52 license = licenses.gpl3;
53 maintainers = with lib.maintainers; [ sents ];
54 homepage = "https://github.com/MarianArlt/sddm-chili";
55 description = "Chili login theme for SDDM";
56 longDescription = ''
57 Chili is hot, just like a real chili!
58 Spice up the login experience for your users, your family and yourself.
59 Chili reduces all the clutter and leaves you with a clean, easy to use, login interface with a modern yet classy touch.
60 '';
61 };
62}