ripasso-cursive: cosmetic changes (#361736)
[NixPkgs.git] / pkgs / by-name / ca / catppuccin-sddm / package.nix
blob1daab09ae646db1a1da97ebfca1b76f1779cd764
2   lib,
3   stdenvNoCC,
4   fetchFromGitHub,
5   just,
6   kdePackages,
7   flavor ? "mocha",
8   font ? "Noto Sans",
9   fontSize ? "9",
10   background ? null,
11   loginBackground ? false,
13 stdenvNoCC.mkDerivation rec {
14   pname = "catppuccin-sddm";
15   version = "1.0.0";
17   src = fetchFromGitHub {
18     owner = "catppuccin";
19     repo = "sddm";
20     rev = "v${version}";
21     hash = "sha256-SdpkuonPLgCgajW99AzJaR8uvdCPi4MdIxS5eB+Q9WQ=";
22   };
24   dontWrapQtApps = true;
26   nativeBuildInputs = [
27     just
28   ];
30   propagatedBuildInputs = [
31     kdePackages.qtsvg
32   ];
34   buildPhase = ''
35     runHook preBuild
37     just build
39     runHook postBuild
40   '';
42   installPhase = ''
43     runHook preInstall
45     mkdir -p "$out/share/sddm/themes/"
46     cp -r dist/catppuccin-${flavor} "$out/share/sddm/themes/catppuccin-${flavor}"
48     configFile=$out/share/sddm/themes/catppuccin-${flavor}/theme.conf
50     substituteInPlace $configFile \
51       --replace-fail 'Font="Noto Sans"' 'Font="${font}"' \
52       --replace-fail 'FontSize=9' 'FontSize=${fontSize}'
54     ${lib.optionalString (background != null) ''
55       substituteInPlace $configFile \
56         --replace-fail 'Background="backgrounds/wall.jpg"' 'Background="${background}"' \
57         --replace-fail 'CustomBackground="false"' 'CustomBackground="true"'
58     ''}
60     ${lib.optionalString loginBackground ''
61       substituteInPlace $configFile \
62         --replace-fail 'LoginBackground="false"' 'LoginBackground="true"'
63     ''}
65     runHook postInstall
66   '';
68   postFixup = ''
69     mkdir -p $out/nix-support
70     echo ${kdePackages.qtsvg} >> $out/nix-support/propagated-user-env-packages
71   '';
73   meta = {
74     description = "Soothing pastel theme for SDDM";
75     homepage = "https://github.com/catppuccin/sddm";
76     license = lib.licenses.mit;
77     maintainers = with lib.maintainers; [elysasrc];
78     platforms = lib.platforms.linux;
79   };