fix(nixos): sddm package not being installed (#194)

* chore: rename `mkFlavourOpt` to `mkFlavorOpt`

Missed by fea5242

* fix(nixos): sddm package not being installed

Never use attrset merge operator with `mk*` attrsets since the right hand attrset overrides the left
This commit is contained in:
Weathercold 2024-05-28 02:49:04 -04:00 committed by GitHub
parent f32e5ab2b5
commit 144b70d50e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 20 deletions

View file

@ -27,7 +27,7 @@ in
# this creates a flavor option for modules # this creates a flavor option for modules
# the first string should be the name of the module, # the first string should be the name of the module,
# followed by the local config attrset # followed by the local config attrset
mkFlavourOpt = ctp.mkBasicOpt "flavor" ctp.types.flavorOption; mkFlavorOpt = ctp.mkBasicOpt "flavor" ctp.types.flavorOption;
types = { types = {
flavorOption = lib.types.enum [ flavorOption = lib.types.enum [
@ -114,7 +114,7 @@ in
enable = lib.mkEnableOption "Catppuccin theme" // { enable = lib.mkEnableOption "Catppuccin theme" // {
default = config.catppuccin.enable; default = config.catppuccin.enable;
}; };
flavor = ctp.mkFlavourOpt name; flavor = ctp.mkFlavorOpt name;
}; };
# string -> a -> a # string -> a -> a

View file

@ -13,12 +13,16 @@ let
versionAtLeast versionAtLeast
; ;
cfg = config.services.displayManager.sddm.catppuccin; cfg = config.services.displayManager.sddm.catppuccin;
enable = cfg.enable && config.services.displayManager.sddm.enable; enable =
versionAtLeast ctp.getModuleRelease minVersion
&& cfg.enable
&& config.services.displayManager.sddm.enable;
# versions >= 24.05 renamed `services.xserver.displayManager` to `services.displayManager` # versions >= 24.05 renamed `services.xserver.displayManager` to `services.displayManager`
# TODO: remove when 24.05 is stable # TODO: remove when 24.05 is stable
minVersion = "24.05"; minVersion = "24.05";
in in
{ {
options.services.displayManager = ctp.mkVersionedOpts minVersion { options.services.displayManager = ctp.mkVersionedOpts minVersion {
sddm.catppuccin = ctp.mkCatppuccinOpt "sddm" // { sddm.catppuccin = ctp.mkCatppuccinOpt "sddm" // {
@ -48,21 +52,18 @@ in
}; };
}; };
config = config = mkIf enable {
mkIf enable { services.displayManager.sddm.theme = "catppuccin-${cfg.flavor}";
environment.systemPackages = [ environment.systemPackages = [
(pkgs.catppuccin-sddm.override { (pkgs.catppuccin-sddm.override {
inherit (cfg) inherit (cfg)
flavor flavor
font font
fontSize fontSize
background background
loginBackground loginBackground
; ;
}) })
]; ];
} };
// mkIf (enable && versionAtLeast ctp.getModuleRelease minVersion) {
services.displayManager.sddm.theme = "catppuccin-${cfg.flavor}";
};
} }