2024-05-21 14:53:46 -07:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
...
|
2024-05-13 18:56:27 -07:00
|
|
|
}:
|
|
|
|
let
|
2024-05-21 14:53:46 -07:00
|
|
|
inherit (lib)
|
|
|
|
mkIf
|
|
|
|
ctp
|
|
|
|
types
|
|
|
|
mkOption
|
|
|
|
;
|
2024-05-13 18:56:27 -07:00
|
|
|
cfg = config.services.displayManager.sddm.catppuccin;
|
2024-06-04 04:29:28 -07:00
|
|
|
enable = cfg.enable && config.services.displayManager.sddm.enable;
|
2024-05-13 18:56:27 -07:00
|
|
|
in
|
2024-05-27 23:49:04 -07:00
|
|
|
|
2024-05-13 18:56:27 -07:00
|
|
|
{
|
2024-06-28 09:29:30 -07:00
|
|
|
options.services.displayManager.sddm.catppuccin = ctp.mkCatppuccinOpt { name = "sddm"; } // {
|
2024-06-04 04:29:28 -07:00
|
|
|
font = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "Noto Sans";
|
|
|
|
description = "Font to use for the login screen";
|
|
|
|
};
|
2024-05-13 18:56:27 -07:00
|
|
|
|
2024-06-04 04:29:28 -07:00
|
|
|
fontSize = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "9";
|
|
|
|
description = "Font size to use for the login screen";
|
|
|
|
};
|
2024-05-13 18:56:27 -07:00
|
|
|
|
2024-06-04 04:29:28 -07:00
|
|
|
background = mkOption {
|
|
|
|
type = with types; (either path str);
|
|
|
|
default = "";
|
|
|
|
description = "Background image to use for the login screen";
|
|
|
|
};
|
2024-05-13 18:56:27 -07:00
|
|
|
|
2024-06-04 04:29:28 -07:00
|
|
|
loginBackground = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
description = "Add an additional background layer to the login panel";
|
2024-05-21 14:53:46 -07:00
|
|
|
};
|
2024-06-22 05:31:23 -07:00
|
|
|
|
|
|
|
assertQt6Sddm =
|
|
|
|
lib.mkEnableOption ''
|
|
|
|
checking if `services.displayManager.sddm.package` is the Qt 6 version.
|
|
|
|
|
|
|
|
This is to ensure the theme is applied properly, but may have false positives in the case of overridden packages for example
|
|
|
|
''
|
|
|
|
// {
|
|
|
|
default = true;
|
|
|
|
};
|
2024-05-20 21:34:42 -07:00
|
|
|
};
|
2024-05-13 18:56:27 -07:00
|
|
|
|
2024-05-27 23:49:04 -07:00
|
|
|
config = mkIf enable {
|
2024-06-22 05:31:23 -07:00
|
|
|
assertions = lib.optional cfg.assertQt6Sddm {
|
|
|
|
assertion = config.services.displayManager.sddm.package == pkgs.kdePackages.sddm;
|
|
|
|
message = ''
|
|
|
|
Only the Qt 6 version of SDDM is supported by this port!
|
|
|
|
|
|
|
|
In most cases this can be resolved by setting `services.displayManager.sddm.package`
|
|
|
|
to `pkgs.kdePackages.sddm`. If you know what you're doing and wish to disable this check,
|
|
|
|
please set `services.displayManager.sddm.catppuccin.assertQt6Sddm` to `false`
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-05-27 23:49:04 -07:00
|
|
|
services.displayManager.sddm.theme = "catppuccin-${cfg.flavor}";
|
2024-06-22 05:31:23 -07:00
|
|
|
|
2024-05-27 23:49:04 -07:00
|
|
|
environment.systemPackages = [
|
|
|
|
(pkgs.catppuccin-sddm.override {
|
|
|
|
inherit (cfg)
|
|
|
|
flavor
|
|
|
|
font
|
|
|
|
fontSize
|
|
|
|
background
|
|
|
|
loginBackground
|
|
|
|
;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
2024-05-13 18:56:27 -07:00
|
|
|
}
|