From b6c854508d8c03f3ff06bf658d12b0ae8052d7a5 Mon Sep 17 00:00:00 2001 From: Isabel Date: Sat, 22 Jun 2024 13:31:23 +0100 Subject: [PATCH] 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 --- modules/nixos/sddm.nix | 22 ++++++++++++++++++++++ test.nix | 6 ++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/modules/nixos/sddm.nix b/modules/nixos/sddm.nix index 1f36de1..e3b97fb 100644 --- a/modules/nixos/sddm.nix +++ b/modules/nixos/sddm.nix @@ -40,10 +40,32 @@ in default = true; 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 { + 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}"; + environment.systemPackages = [ (pkgs.catppuccin-sddm.override { inherit (cfg) diff --git a/test.nix b/test.nix index f43c870..6b73ce8 100644 --- a/test.nix +++ b/test.nix @@ -29,7 +29,7 @@ testers.runNixOSTest { name = "module-test"; nodes.machine = - { lib, ... }: + { lib, pkgs, ... }: { imports = [ home-manager.nixosModules.default @@ -43,7 +43,9 @@ testers.runNixOSTest { }; 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 };