diff --git a/modules/nixos/sddm.nix b/modules/nixos/sddm.nix new file mode 100644 index 00000000..4469642d --- /dev/null +++ b/modules/nixos/sddm.nix @@ -0,0 +1,50 @@ +{ lib +, pkgs +, config +, ... +}: +let + cfg = config.services.displayManager.sddm.catppuccin; + enable = cfg.enable && config.services.displayManager.sddm.enable; + + inherit (lib) mkIf ctp types mkOption; +in +{ + options.displayManager.sddm.catppuccin = + ctp.mkCatppuccinOpt "sddm" + // { + font = mkOption { + type = types.str; + default = "Noto Sans"; + description = "Font to use for the login screen"; + }; + + fontSize = mkOption { + type = types.int; + default = 9; + description = "Font size to use for the login screen"; + }; + + background = mkOption { + type = types.nullOr types.path; + default = null; + description = "Background image to use for the login screen"; + }; + + loginBackground = mkOption { + type = types.bool; + default = true; + description = "Add an additonal background layer to the login panel"; + }; + }; + + config = mkIf enable { + displayManager.sddm.theme = "catppuccin-${cfg.flavour}"; + + environment.systemPackages = [ + (pkgs.catppuccin-sddm.override { + inherit (cfg) flavor font fontSize background loginBackground; + }) + ]; + }; +} diff --git a/test.nix b/test.nix index ab577dbe..512d96b3 100644 --- a/test.nix +++ b/test.nix @@ -1,4 +1,7 @@ -{ testers, home-manager }: +{ testers +, home-manager +, +}: let common = { catppuccin.enable = true; @@ -88,14 +91,17 @@ testers.runNixOSTest { yazi = enable; zathura = enable; zellij = enable; - zsh = enable // { - syntaxHighlighting = enable; - }; + zsh = + enable + // { + syntaxHighlighting = enable; + }; }; gtk = lib.recursiveUpdate enable { catppuccin.cursor.enable = true; }; services = { + displayManager.sddm = enable; dunst = enable; mako = enable; polybar =