1{
2 pkgs,
3 lib,
4 stdenvNoCC,
5 themeConfig ? null,
6 embeddedTheme ? "astronaut",
7}:
8stdenvNoCC.mkDerivation rec {
9 pname = "sddm-astronaut";
10 version = "1.0-unstable-2025-01-05";
11
12 src = pkgs.fetchFromGitHub {
13 owner = "Keyitdev";
14 repo = "sddm-astronaut-theme";
15 rev = "11c0bf6147bbea466ce2e2b0559e9a9abdbcc7c3";
16 hash = "sha256-gBSz+k/qgEaIWh1Txdgwlou/Lfrfv3ABzyxYwlrLjDk=";
17 };
18
19 dontWrapQtApps = true;
20
21 propagatedBuildInputs = with pkgs.kdePackages; [
22 qtsvg
23 qtmultimedia
24 qtvirtualkeyboard
25 ];
26
27 installPhase =
28 let
29 iniFormat = pkgs.formats.ini { };
30 configFile = iniFormat.generate "" { General = themeConfig; };
31
32 basePath = "$out/share/sddm/themes/sddm-astronaut-theme";
33 sedString = "ConfigFile=Themes/";
34 in
35 ''
36 mkdir -p ${basePath}
37 cp -r $src/* ${basePath}
38 ''
39 + lib.optionalString (embeddedTheme != "astronaut") ''
40
41 # Replaces astronaut.conf with embedded theme in metadata.desktop on line 9.
42 # ConfigFile=Themes/astronaut.conf.
43 sed -i "s|^${sedString}.*\\.conf$|${sedString}${embeddedTheme}.conf|" ${basePath}/metadata.desktop
44 ''
45 + lib.optionalString (themeConfig != null) ''
46 chmod u+w ${basePath}/Themes/
47 ln -sf ${configFile} ${basePath}/Themes/${embeddedTheme}.conf.user
48 '';
49
50 meta = {
51 description = "Modern looking qt6 sddm theme";
52 homepage = "https://github.com/${src.owner}/${src.repo}";
53 license = lib.licenses.gpl3;
54
55 platforms = lib.platforms.linux;
56 maintainers = with lib.maintainers; [
57 danid3v
58 uxodb
59 ];
60 };
61}