# How do I apply an custom theme to SDDM?

**URL:** https://discourse.nixos.org/t/how-do-i-apply-an-custom-theme-to-sddm/29281
**Category:** Help
**Created:** [June 18, 2023, 2:55pm UTC](https://discourse.nixos.org/t/how-do-i-apply-an-custom-theme-to-sddm/29281 "2023-06-18T14:55:41Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![xanrer](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/x/a9a28c/32.png) [@xanrer](https://discourse.nixos.org/u/xanrer)
#### Post date: [June 18, 2023, 2:55pm UTC](https://discourse.nixos.org/t/how-do-i-apply-an-custom-theme-to-sddm/29281/1 "2023-06-18T14:55:41Z")

</div>

I want to use the [dialog](https://github.com/joshuakraemer/sddm-theme-dialog) theme for my SDDM. The only mention I found on the forum to this problem was [this](https://discourse.nixos.org/t/change-ssdm-theme-am-i-doing-it-right/5062) and I didn’t quite get it. Can anybody explain what I have to do? I didn’t wanted to necrobump the other topic.

---

<div class="post-metadata">

### Author: ![xanrer](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/x/a9a28c/32.png) [@xanrer](https://discourse.nixos.org/u/xanrer)
#### Post date: [June 22, 2023, 6:26pm UTC](https://discourse.nixos.org/t/how-do-i-apply-an-custom-theme-to-sddm/29281/2 "2023-06-22T18:26:36Z")

</div>

I’m assuming SDDM theming is impossible, so the issue can be closed.

---

<div class="post-metadata">

### Author: ![quasigod](https://discourse.nixos.org/user_avatar/discourse.nixos.org/quasigod/32/37014_2.png) [@quasigod](https://discourse.nixos.org/u/quasigod)
#### Post date: [June 22, 2023, 6:35pm UTC](https://discourse.nixos.org/t/how-do-i-apply-an-custom-theme-to-sddm/29281/3 "2023-06-22T18:35:58Z")

</div>

It can be done using the options `services.xserver.displayManager.sddm.theme`. You’ll need to package the theme yourself, then add it to your packages.

Here is an example of an sddm theme package from the thread you mentioned: [nixos-config/nixpkgs/pkgs/sddm-themes.nix at michaelpj/nixos-config · GitHub](https://github.com/michaelpj/nixos-config/blob/e5be6d0f0e431748c0a8c532f9776c14e67ed8c9/nixpkgs/pkgs/sddm-themes.nix)

---

<div class="post-metadata">

### Author: ![xanrer](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/x/a9a28c/32.png) [@xanrer](https://discourse.nixos.org/u/xanrer)
#### Post date: [June 22, 2023, 6:49pm UTC](https://discourse.nixos.org/t/how-do-i-apply-an-custom-theme-to-sddm/29281/4 "2023-06-22T18:49:44Z")

</div>

Can you explain how can I add a custom script as a theme? Also, are SDDM theme packages allowed to enter the official Nix package base? Because if I’m going to package it I would like to share that with everyone.

---

<div class="post-metadata">

### Author: ![quasigod](https://discourse.nixos.org/user_avatar/discourse.nixos.org/quasigod/32/37014_2.png) [@quasigod](https://discourse.nixos.org/u/quasigod)
#### Post date: [June 22, 2023, 7:06pm UTC](https://discourse.nixos.org/t/how-do-i-apply-an-custom-theme-to-sddm/29281/5 "2023-06-22T19:06:19Z")

</div>

I’m not sure what you mean by a custom script. The link I shared with you should show how you can make the package. You can add this package to your system by adding something like this to your configuration:

```nix
environment.systemPackages = with pkgs; [
    (callPackage ./path/to/package.nix)
];

```

SDDM themes should be allowed. I don’t know if any are currently packaged, but there are plenty of other types of themes available, so I don’t see why not.

---

<div class="post-metadata">

### Author: ![xanrer](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/x/a9a28c/32.png) [@xanrer](https://discourse.nixos.org/u/xanrer)
#### Post date: [June 22, 2023, 7:16pm UTC](https://discourse.nixos.org/t/how-do-i-apply-an-custom-theme-to-sddm/29281/6 "2023-06-22T19:16:38Z")

</div>

Thank you very much! I’ll try them!

---

<div class="post-metadata">

### Author: ![quasigod](https://discourse.nixos.org/user_avatar/discourse.nixos.org/quasigod/32/37014_2.png) [@quasigod](https://discourse.nixos.org/u/quasigod)
#### Post date: [June 22, 2023, 7:26pm UTC](https://discourse.nixos.org/t/how-do-i-apply-an-custom-theme-to-sddm/29281/7 "2023-06-22T19:26:15Z")

</div>

Good luck! Feel free to ask if you have any trouble packaging it.

---

<div class="post-metadata">

### Author: ![xanrer](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/x/a9a28c/32.png) [@xanrer](https://discourse.nixos.org/u/xanrer)
#### Post date: [June 25, 2023, 3:23pm UTC](https://discourse.nixos.org/t/how-do-i-apply-an-custom-theme-to-sddm/29281/8 "2023-06-25T15:23:49Z")

</div>

Ok, I have hit a wall,  
here is how my `sddm-theme-dialog.nix` looks like:

```auto
{ stdenv, fetchFromGitHub }:
{
  sddm-theme-dialog = stdenv.mkDerivation rec {
    pname = "sddm-theme-dialog";
    version = "53f81e3";
    dontBuild = true;
    installPhase = ''
      mkdir -p $out/share/sddm/themes
      cp -aR $src $out/share/sddm/themes/sddm-theme-dialog
    '';
    src = fetchFromGitHub {
      owner = "joshuakraemer";
      repo = "sddm-theme-dialog";
      rev = "53f81e322f715d3f8e3f41c38eb3774b1be4c19b";
      sha256 = "qoLSRnQOvH3rAH+G1eRrcf9ZB6WlSRIZjYZBOTkew/0=";
    };
  };
}

```

And yes rev and sha is correct. I got them with `nix-prefetch-github joshuakraemer sddm-theme-dialog` I added the following line to my packages list in nix config: `/home/myusername/Downloads/sddm-theme-dialog.nix`

But it gives me the following error:

```auto
error: A definition for option `users.users.myusername.packages."[definition 1-entry 10]"' is not of type `package'. Definition values:
       - In `/etc/nixos/configuration.nix': /home/myusername/Downloads/sddm-themes.nix

```

What to do now?

---

<div class="post-metadata">

### Author: ![quasigod](https://discourse.nixos.org/user_avatar/discourse.nixos.org/quasigod/32/37014_2.png) [@quasigod](https://discourse.nixos.org/u/quasigod)
#### Post date: [June 25, 2023, 7:20pm UTC](https://discourse.nixos.org/t/how-do-i-apply-an-custom-theme-to-sddm/29281/9 "2023-06-25T19:20:37Z")

</div>

The line you added to your packages is incorrect, you need to use callPackage as I showed in my other comment. I’m not sure it will work when installed as a per user package, you might need to use environment.systemPackages like I showed.

---

<div class="post-metadata">

### Author: ![xanrer](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/x/a9a28c/32.png) [@xanrer](https://discourse.nixos.org/u/xanrer)
#### Post date: [June 25, 2023, 7:43pm UTC](https://discourse.nixos.org/t/how-do-i-apply-an-custom-theme-to-sddm/29281/10 "2023-06-25T19:43:59Z")

</div>

Sorry for the first confusion.

With:

```auto
  environment.systemPackages = with pkgs; [
    (callPackage /home/myusername/Downloads/sddm-theme-dialog.nix)
  ];

```

Error has changed to:

```auto
error: A definition for option `environment.systemPackages."[definition 1-entry 1]"' is not of type `package'. Definition values:
       - In `/etc/nixos/configuration.nix': <function>

```

Perhaps there is a problem with the file?

---

<div class="post-metadata">

### Author: ![NobbZ](https://discourse.nixos.org/user_avatar/discourse.nixos.org/nobbz/32/7022_2.png) [@NobbZ](https://discourse.nixos.org/u/NobbZ)
#### Post date: [June 25, 2023, 7:50pm UTC](https://discourse.nixos.org/t/how-do-i-apply-an-custom-theme-to-sddm/29281/11 "2023-06-25T19:50:25Z")

</div>

`callPackage` requires a second argument. The overrides you want to pass. Most of the time its just the empty set.

---

<div class="post-metadata">

### Author: ![xanrer](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/x/a9a28c/32.png) [@xanrer](https://discourse.nixos.org/u/xanrer)
#### Post date: [June 25, 2023, 8:01pm UTC](https://discourse.nixos.org/t/how-do-i-apply-an-custom-theme-to-sddm/29281/12 "2023-06-25T20:01:18Z")

</div>

You got it boss:

```auto
  environment.systemPackages = with pkgs; [
    (callPackage /home/myusername/Downloads/sddm-theme-dialog.nix {})
  ];

```

```auto
error: A definition for option `environment.systemPackages."[definition 1-entry 1]"' is not of type `package'. Definition values:
       - In `/etc/nixos/configuration.nix':
           {
             override = <function, args: {fetchFromGitHub, stdenv}>;
             overrideDerivation = <function>;
             sddm-theme-dialog = <derivation sddm-theme-dialog-53f81e3>;
           }

```

---

<div class="post-metadata">

### Author: ![NobbZ](https://discourse.nixos.org/user_avatar/discourse.nixos.org/nobbz/32/7022_2.png) [@NobbZ](https://discourse.nixos.org/u/NobbZ)
#### Post date: [June 25, 2023, 8:19pm UTC](https://discourse.nixos.org/t/how-do-i-apply-an-custom-theme-to-sddm/29281/13 "2023-06-25T20:19:01Z")

</div>

I haven’t looked at the callPackaged expression first, but now.

It would work with `(callPackage /home/myusername/Downloads/sddm-theme-dialog.nix {}).sddm-theme-dialog`.

---

<div class="post-metadata">

### Author: ![xanrer](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/x/a9a28c/32.png) [@xanrer](https://discourse.nixos.org/u/xanrer)
#### Post date: [June 25, 2023, 8:30pm UTC](https://discourse.nixos.org/t/how-do-i-apply-an-custom-theme-to-sddm/29281/14 "2023-06-25T20:30:33Z")

</div>

That did it! Although now it only shows the virtual keyboard for some reason…  
Also for getting this to nix repo, I just have to follow [this](https://nixos.org/manual/nixpkgs/stable/#chap-quick-start) right?

---

<div class="post-metadata">

### Author: ![quasigod](https://discourse.nixos.org/user_avatar/discourse.nixos.org/quasigod/32/37014_2.png) [@quasigod](https://discourse.nixos.org/u/quasigod)
#### Post date: [June 26, 2023, 1:29pm UTC](https://discourse.nixos.org/t/how-do-i-apply-an-custom-theme-to-sddm/29281/15 "2023-06-26T13:29:12Z")

</div>

Yep, reading the contribution section should tell you what you need. I would recommend changing your package expression slightly before adding, you don’t need the `sddm-theme-dialog =`. This is also why you needed `(callPackage /home/myusername/Downloads/sddm-theme-dialog.nix {}).sddm-theme-dialog` instead of just `(callPackage /home/myusername/Downloads/sddm-theme-dialog.nix {})`.

```auto
{ stdenv, fetchFromGitHub }:
{
  stdenv.mkDerivation rec {
    pname = "sddm-theme-dialog";
    version = "53f81e3";
    dontBuild = true;
    installPhase = ''
      mkdir -p $out/share/sddm/themes
      cp -aR $src $out/share/sddm/themes/sddm-theme-dialog
    '';
    src = fetchFromGitHub {
      owner = "joshuakraemer";
      repo = "sddm-theme-dialog";
      rev = "53f81e322f715d3f8e3f41c38eb3774b1be4c19b";
      sha256 = "qoLSRnQOvH3rAH+G1eRrcf9ZB6WlSRIZjYZBOTkew/0=";
    };
  };
}

```
