fix(nixos): use the qt 6 version of sddm (#230)

* fix(nixos): use the qt 6 version of sddm

the upstream port has moved to qt 6, while nixos' default is still qt 5

* chore(nixos): use the qt6 version of sddm in tests

---------

Co-authored-by: seth <getchoo@tuta.io>
This commit is contained in:
Isabel 2024-06-22 13:31:23 +01:00 committed by GitHub
parent cc8d3b17d2
commit b6c854508d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 2 deletions

View file

@ -40,10 +40,32 @@ in
default = true; default = true;
description = "Add an additional background layer to the login panel"; description = "Add an additional background layer to the login panel";
}; };
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;
};
}; };
config = mkIf enable { config = mkIf enable {
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`
'';
};
services.displayManager.sddm.theme = "catppuccin-${cfg.flavor}"; services.displayManager.sddm.theme = "catppuccin-${cfg.flavor}";
environment.systemPackages = [ environment.systemPackages = [
(pkgs.catppuccin-sddm.override { (pkgs.catppuccin-sddm.override {
inherit (cfg) inherit (cfg)

View file

@ -29,7 +29,7 @@ testers.runNixOSTest {
name = "module-test"; name = "module-test";
nodes.machine = nodes.machine =
{ lib, ... }: { lib, pkgs, ... }:
{ {
imports = [ imports = [
home-manager.nixosModules.default home-manager.nixosModules.default
@ -43,7 +43,9 @@ testers.runNixOSTest {
}; };
services = { services = {
displayManager.sddm = enable; displayManager.sddm = enable // {
package = pkgs.kdePackages.sddm; # our module/the upstream port requires the qt6 version
};
xserver.enable = true; # required for sddm xserver.enable = true; # required for sddm
}; };