From f89d1c0f4143f5d31d6ac18e5fa5bef42fe64b4c Mon Sep 17 00:00:00 2001 From: punkfairie Date: Sun, 20 Oct 2024 17:26:38 -0700 Subject: [PATCH] feat(sddm): Catppuccin -> Rose Pine --- .sources/sources.json | 12 +++++ modules/nixos/sddm.nix | 99 +++++++++++++----------------------------- 2 files changed, 41 insertions(+), 70 deletions(-) diff --git a/.sources/sources.json b/.sources/sources.json index f991a3d..e47fb6e 100644 --- a/.sources/sources.json +++ b/.sources/sources.json @@ -300,6 +300,18 @@ "url": "https://github.com/d2718nis/rose-pine-swaylock/archive/8a2aefbc9996941535bb10f0df5357687c43c06a.tar.gz", "hash": "15inlf8j6vn5k9d71lzmxsrqn55qha1idmpxbk4v1ji0sywrw1f6" }, + "sddm-rose-pine": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "lwndhrst", + "repo": "sddm-rose-pine" + }, + "branch": "master", + "revision": "e8735051bf4a418efaf076f52cb3d7873ccd1509", + "url": "https://github.com/lwndhrst/sddm-rose-pine/archive/e8735051bf4a418efaf076f52cb3d7873ccd1509.tar.gz", + "hash": "1vdmxjkacv5il8gpdxgw7zbmy442b9wrv47az3yw1wwwd8wr6pzl" + }, "starship": { "type": "Git", "repository": { diff --git a/modules/nixos/sddm.nix b/modules/nixos/sddm.nix index 3f03b02..b04dd76 100644 --- a/modules/nixos/sddm.nix +++ b/modules/nixos/sddm.nix @@ -1,81 +1,40 @@ { lib, - pkgs, config, ... -}: -let - inherit (lib) - mkIf - ctp - types - mkOption - ; - cfg = config.services.displayManager.sddm.catppuccin; +}: let + inherit (config.rose-pine) sources; + cfg = config.services.displayManager.sddm.rose-pine; enable = cfg.enable && config.services.displayManager.sddm.enable; -in +in { + options.services.displayManager.sddm.rose-pine = lib.rp.mkRosePineOpt {name = "sddm";}; -{ - options.services.displayManager.sddm.catppuccin = ctp.mkCatppuccinOpt { name = "sddm"; } // { - font = mkOption { - type = types.str; - default = "Noto Sans"; - description = "Font to use for the login screen"; - }; - - fontSize = mkOption { - type = types.str; - default = "9"; - description = "Font size to use for the login screen"; - }; - - background = mkOption { - type = with types; (either path str); - default = ""; - description = "Background image to use for the login screen"; - }; - - loginBackground = mkOption { - type = types.bool; - 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}"; + config = lib.mkIf enable { + services.displayManager.sddm.theme = "rose-pine"; environment.systemPackages = [ - (pkgs.catppuccin-sddm.override { - inherit (cfg) - flavor - font - fontSize - background - loginBackground - ; - }) + ( + { + stdenvNoCC, + libsForQt5, + }: + stdenvNoCC.mkDerivation { + pname = "sddm-rose-pine-theme"; + version = "1.2"; + dontBuild = true; + + propagatedUserEnvPkgs = [ + libsForQt5.qt5.qtgraphicaleffects + ]; + + src = sources.sddm; + + installPhase = '' + mkdir -p $out/share/sddm/themes + cp -aR $src $out/share/sddm/themes/rose-pine + ''; + } + ) ]; }; }