diff --git a/configuration.nix b/configuration.nix index a540a5a2..6d92d708 100644 --- a/configuration.nix +++ b/configuration.nix @@ -3,6 +3,7 @@ , lib , desktopName , hostname +, config , inputs , ... }: @@ -143,7 +144,7 @@ with lib; rec { }; }; - # Internal modules + # Internal modulesjournalctl -xeu display-manager.service modules = let enableDesktop = attrsets.optionalAttrs (desktopName != "") ({ @@ -151,7 +152,7 @@ with lib; rec { "${desktopName}".enable = true; sddm = { enable = true; - theme = "dexy"; + package = pkgs.catppuccin-sddm-corners; }; }; }); diff --git a/modules/desktop/sddm.nix b/modules/desktop/sddm.nix index 321fdba1..5a00a57c 100644 --- a/modules/desktop/sddm.nix +++ b/modules/desktop/sddm.nix @@ -1,63 +1,42 @@ -{ config, pkgs, lib, privateRepo, ... }: +{ config, pkgs, lib, ... }: with lib; with lib.my; let cfg = config.modules.desktop.sddm; - splitByMinus = n: strings.splitString "-" n; + theme = trivial.pipe (cfg.package + "/share/sddm/themes") [ + builtins.readDir + builtins.attrNames + builtins.head + ]; - pkgNames = attrsets.mapAttrsToList (_: v: if v ? pname then v.pname else v.name) privateRepo; - sddmPkgNames = builtins.filter (x: builtins.any (e: e == "sddm") (splitByMinus x)) pkgNames; - sddmThemeNames = builtins.map - (x: - let - themeNameParts = splitByMinus (builtins.head (strings.splitString "sddm" x)); - themeName = lists.take ((builtins.length themeNameParts) - 1) themeNameParts; - in - strings.concatStringsSep "-" themeName) - sddmPkgNames; + extraPackages = trivial.pipe cfg.package [ + builtins.attrNames + (builtins.filter (strings.hasPrefix "propagated")) + (builtins.map (x: cfg.package."${x}")) + lists.flatten + ]; in { options.modules.desktop.sddm = { enable = mkEnableOption "Enable SDDM as display manager"; - theme = mkOption { - type = types.enum sddmThemeNames; - default = "dexy"; - example = "wings"; - description = "SDDM theme from privateRepo"; + package = mkOption { + type = types.package; + example = pkgs.dexy; + description = "Package of sddm theme"; }; }; config = mkIf cfg.enable { - environment.systemPackages = [ pkgs."${cfg.theme}" ]; + environment.systemPackages = [ cfg.package ]; services.displayManager.sddm = { - enable = cfg.enable; - theme = cfg.theme; - extraPackages = - let - gstreamerDeps = with pkgs.gst_all_1; [ - gstreamer - gst-plugins-ugly - gst-plugins-bad - gst-plugins-good - gst-plugins-base - gst-libav - ]; - plasmaDeps = with pkgs.libsForQt5; [ - plasma-framework - plasma-workspace - ]; - qt5Deps = with pkgs.libsForQt5.qt5; [ - qtgraphicaleffects - qtquickcontrols2 - qtbase - qtsvg - qtmultimedia - pkgs.libsForQt5.phonon-backend-gstreamer - ]; - in - qt5Deps ++ gstreamerDeps ++ plasmaDeps; + inherit theme extraPackages; + + enable = true; autoNumlock = true; + settings = { + General.InputMethod=""; + }; }; }; } diff --git a/pkgs/sddm/theme/dexy/default.nix b/pkgs/sddm/theme/dexy/default.nix index 97ea058b..d5f9b643 100644 --- a/pkgs/sddm/theme/dexy/default.nix +++ b/pkgs/sddm/theme/dexy/default.nix @@ -1,6 +1,8 @@ { lib , stdenv , fetchFromGitHub +, libsForQt5 +, kdePackages }: stdenv.mkDerivation { name = "dexy-sddm-theme"; @@ -13,6 +15,12 @@ dontWrapQtApps = true; + propagatedUserEnvPkgs = with libsForQt5; [ + plasma-framework + plasma-workspace + kdePackages.sddm + ]; + installPhase = '' mkdir -p $out/share/sddm/themes cp -r ./Dexy-Color-SDDM $out/share/sddm/themes/dexy diff --git a/shells/desktop.nix b/shells/desktop.nix index 4a83daac..342a4672 100644 --- a/shells/desktop.nix +++ b/shells/desktop.nix @@ -46,6 +46,7 @@ let plasmaDeps = with libsForQt5; [ plasma-framework plasma-workspace + unstable.kdePackages.sddm ]; qt5Deps = with libsForQt5.qt5; [ qtgraphicaleffects