Skip to content

Commit

Permalink
feat(sddm): changed theme to catppuccin-sddm-corners
Browse files Browse the repository at this point in the history
  • Loading branch information
Wittano committed Jun 19, 2024
1 parent 2f0adf2 commit e89efe5
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 46 deletions.
5 changes: 3 additions & 2 deletions configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, lib
, desktopName
, hostname
, config
, inputs
, ...
}:
Expand Down Expand Up @@ -143,15 +144,15 @@ with lib; rec {
};
};

# Internal modules
# Internal modulesjournalctl -xeu display-manager.service
modules =
let
enableDesktop = attrsets.optionalAttrs (desktopName != "") ({
desktop = {
"${desktopName}".enable = true;
sddm = {
enable = true;
theme = "dexy";
package = pkgs.catppuccin-sddm-corners;
};
};
});
Expand Down
67 changes: 23 additions & 44 deletions modules/desktop/sddm.nix
Original file line number Diff line number Diff line change
@@ -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="";
};
};
};
}
8 changes: 8 additions & 0 deletions pkgs/sddm/theme/dexy/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{ lib
, stdenv
, fetchFromGitHub
, libsForQt5
, kdePackages
}: stdenv.mkDerivation {
name = "dexy-sddm-theme";

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions shells/desktop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ let
plasmaDeps = with libsForQt5; [
plasma-framework
plasma-workspace
unstable.kdePackages.sddm
];
qt5Deps = with libsForQt5.qt5; [
qtgraphicaleffects
Expand Down

0 comments on commit e89efe5

Please sign in to comment.