about summary refs log tree commit diff
path: root/pkgs/by-name/ca/catppuccin-sddm/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/ca/catppuccin-sddm/package.nix')
-rw-r--r--pkgs/by-name/ca/catppuccin-sddm/package.nix80
1 files changed, 80 insertions, 0 deletions
diff --git a/pkgs/by-name/ca/catppuccin-sddm/package.nix b/pkgs/by-name/ca/catppuccin-sddm/package.nix
new file mode 100644
index 0000000000000..1daab09ae646d
--- /dev/null
+++ b/pkgs/by-name/ca/catppuccin-sddm/package.nix
@@ -0,0 +1,80 @@
+{
+  lib,
+  stdenvNoCC,
+  fetchFromGitHub,
+  just,
+  kdePackages,
+  flavor ? "mocha",
+  font ? "Noto Sans",
+  fontSize ? "9",
+  background ? null,
+  loginBackground ? false,
+}:
+stdenvNoCC.mkDerivation rec {
+  pname = "catppuccin-sddm";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "catppuccin";
+    repo = "sddm";
+    rev = "v${version}";
+    hash = "sha256-SdpkuonPLgCgajW99AzJaR8uvdCPi4MdIxS5eB+Q9WQ=";
+  };
+
+  dontWrapQtApps = true;
+
+  nativeBuildInputs = [
+    just
+  ];
+
+  propagatedBuildInputs = [
+    kdePackages.qtsvg
+  ];
+
+  buildPhase = ''
+    runHook preBuild
+
+    just build
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p "$out/share/sddm/themes/"
+    cp -r dist/catppuccin-${flavor} "$out/share/sddm/themes/catppuccin-${flavor}"
+
+    configFile=$out/share/sddm/themes/catppuccin-${flavor}/theme.conf
+
+    substituteInPlace $configFile \
+      --replace-fail 'Font="Noto Sans"' 'Font="${font}"' \
+      --replace-fail 'FontSize=9' 'FontSize=${fontSize}'
+
+    ${lib.optionalString (background != null) ''
+      substituteInPlace $configFile \
+        --replace-fail 'Background="backgrounds/wall.jpg"' 'Background="${background}"' \
+        --replace-fail 'CustomBackground="false"' 'CustomBackground="true"'
+    ''}
+
+    ${lib.optionalString loginBackground ''
+      substituteInPlace $configFile \
+        --replace-fail 'LoginBackground="false"' 'LoginBackground="true"'
+    ''}
+
+    runHook postInstall
+  '';
+
+  postFixup = ''
+    mkdir -p $out/nix-support
+    echo ${kdePackages.qtsvg} >> $out/nix-support/propagated-user-env-packages
+  '';
+
+  meta = {
+    description = "Soothing pastel theme for SDDM";
+    homepage = "https://github.com/catppuccin/sddm";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [elysasrc];
+    platforms = lib.platforms.linux;
+  };
+}