SDDM theme configuration help

how can i change the variant for this sddm theme? GitHub - Keyitdev/sddm-astronaut-theme: Series of modern looking themes for SDDM. · GitHub it says

Selecting a theme

You can select theme by editing metadata (/usr/share/sddm/themes/sddm-astronaut-theme/metadata.desktop).

Just edit this line:

ConfigFile=Themes/astronaut.conf

how do i do that? i have tried this thing i found from github searching but didn’t work

    environment.systemPackages = with pkgs; [
      sddm-sugar-dark
      (sddm-astronaut.override
        {
          themeConfig = {
            theme = "black_hole";
          };
        })
    ];

My entire file for sddm is simply

{
  lib,
  pkgs,
  config,
  ...
}: let
  cfg = config.custom.sddm;
  sddm-astronaut = pkgs.sddm-astronaut.override {
  embeddedTheme = "astronaut";
  # embeddedTheme = "black_hole";
  # embeddedTheme = "cyberpunk";
};
in {
  options.custom.sddm = {
    enable = lib.mkEnableOption "Enable sddm display";
  };

  config = lib.mkIf cfg.enable {
    environment.systemPackages = [
      sddm-astronaut
    ];

    services.displayManager.sddm = {
      enable = true;
      theme = "sddm-astronaut";
      wayland.enable = true;
      extraPackages = [ sddm-astronaut ];
    };
  };
}

So the astronaut theme is already packaged in the nixpkgs:

So with that you can just use it as following:

    services.displayManager.sddm = {
      enable = true;
      theme = "sddm-astronaut-theme";
      settings = {
        Theme = {
          CursorTheme = config.stylix.cursor.name;
          CursorSize = config.stylix.cursor.size;
        };
      };
      extraPackages = with pkgs; [
        kdePackages.qtsvg
        kdePackages.qtvirtualkeyboard
        kdePackages.qtmultimedia
      ];
    };

    environment.systemPackages = with pkgs; [
      (sddm-astronaut.override {
        themeConfig = {
          ScreenWidth = "1920";
          ScreenHeight = "1080";

          Font = config.stylix.fonts.sansSerif.name;
          FontSize = "12";

          RoundCorners = "20";

          BackgroundPlaceholder = "${config.stylix.image}";
          Background =
            if cfg.animatedBackground.enable
            then "${cfg.animatedBackground.path}"
            else "${config.stylix.image}";
          BackgroundSpeed = "1.0";
          PauseBackground = "";
          CropBackground = "false";
          BackgroundHorizontalAlignment = "center";
          BackgroundVerticalAlignment = "center";
          DimBackground = "0.0";
          HeaderTextColor = "${text}";
          DateTextColor = "${text}";
          TimeTextColor = "${text}";

          FormBackgroundColor = "${base}";
          BackgroundColor = "${base}";
          DimBackgroundColor = "${base}";

          LoginFieldBackgroundColor = "#${base}";
          PasswordFieldBackgroundColor = "${base}";
          LoginFieldTextColo = "${mauve}";
          PasswordFieldTestColor = "${mauve}";
          UserIconColor = "${mauve}";
          PasswordIconColor = "${mauve}";

          PlaceholderTextColor = "${surface2}";
          WarningColor = "${red}";

          LoginButtonTextColor = "${mauve}";
          LoginButtonBackgroundColor = "${base}";
          SystemButtonsIconsColor = "${mauve}";
          SessionButtonTextColor = "${mauve}";
          VirtualKeyboardButtonTextColor = "${mauve}";

          DropdownTextColor = "${mauve}";
          DropdownSelectedBackgroundColor = "${base}";
          DropdownBackgroundColor = "${base}";

          HighlightTextColor = "${mauve}";
          HighlightBackgroundColor = "${mauve}";
          HighlightBorderColor = "${mauve}";

          HoverUserIconColor = "${teal}";
          HoverPasswordIconColor = "${teal}";
          HoverSystemButtonsIconsColor = "${teal}";
          HoverSessionButtonTextColor = "${teal}";
          HoverVirtualKeyboardButtonTextColor = "${teal}";

          PartialBlur = "true";
          BlurMax = "35";
          Blur = "2.0";

          HaveFormBackground = "false";
          FormPosition = "left";
        };
      })
    ];
  };
}
Source

Reddit - The heart of the internet

With the override you can then configure the theme

I don’t have stylix set up yet. I just want to change the “variant” of the theme. is this enough for that?

  sddm-astronaut = pkgs.sddm-astronaut.override {
  embeddedTheme = "astronaut";
  # embeddedTheme = "black_hole";
  # embeddedTheme = "cyberpunk";
};

because even with that it is not working. if i leave that out, however, i get the astronaut variant

you can just leave the stylix option out.

That is most likely because the astronaut version is the default. Maybe try the override in the extra packages in the sddm config:

sddm = {
wayland.enable = true;
enable = true;
package = pkgs.kdePackages.sddm;
theme = "sddm-astronaut-theme";
extraPackages = [(pkgs.sddm-astronaut.override {
embeddedTheme = "your_theme";
})];

};

That also seems to not work. There is only the default theme.

ok that is strange. Have you removed all other mentions of the sddm-astronaut package?

It should only be specified in the sddm.extraPackages with the override. Also it is important that you use:

theme = "sddm-astronaut-theme"

To give sddm the correct folder for the theme.

From the NixOS Options it looks like you have to pass the path to the directory:

services.displayManager.sddm.theme = "${pkgs.sddm-astronaut.override { embeddedTheme = "black-hole"; }}/share/sddm/themes/sddm-astronaut-theme"

This would be my guess, I haven’t tested.

This one completely broke the theme, white background, nothing visible except the black characters “password” and “username”.

what broke the theme completley.

This? or this?

Sorry, i thought hitting reply was enough. I am not sure how to cite stuff but this line

services.displayManager.sddm.theme = "${pkgs.sddm-astronaut.override { embeddedTheme = "black-hole"; }}/share/sddm/themes/sddm-astronaut-theme"

the other one just resulted in the default sddm theme again

I found out i need to package it myself apparently. and then use callPackage. This is complicated but i guess i have my answer

I found a solution somebody else used that worked:

1 Like