plasma: Add sddm-sugar-dark as a theme

This commit is contained in:
PapaTutuWawa 2022-07-13 20:19:53 +02:00
parent 4ffded8c0b
commit a27748f63b
4 changed files with 90 additions and 5 deletions

View File

@ -75,7 +75,15 @@
zsh.enable = true; zsh.enable = true;
direnv.enable = true; direnv.enable = true;
office.enable = true; office.enable = true;
plasma.enable = true; plasma = {
enable = true;
sddm = {
backgroundImage = pkgs.fetchurl {
url = "https://cdn.donmai.us/original/d3/1b/__manjuu_prinz_eugen_roon_bismarck_friedrich_der_grosse_and_3_more_azur_lane_drawn_by_zaphn__d31bf4ac564d60f8787818842c369e7f.jpg";
sha256 = "sha256-likoJuEaGzGH0RqjPsBE9o5ATwgnOo97PREh3oZBax8=";
};
};
};
gaming.enable = true; gaming.enable = true;
obs.enable = true; obs.enable = true;
}; };

View File

@ -14,6 +14,20 @@ in {
description = "Ignore NixOS 'recommendations' and use the Wayland session by default"; description = "Ignore NixOS 'recommendations' and use the Wayland session by default";
}; };
}; };
sddm = {
backgroundImage = lib.mkOption {
default = "${pkgs.sddm-sugar-dark}/usr/share/sddm/themes/sugar-dark/Background.jpg";
description = "The background image to use with sddm-sugar-dark";
};
screenWidth = lib.mkOption {
default = 1920;
description = "Width of the screen";
};
screenHeight = lib.mkOption {
default = 1080;
description = "Width of the screen";
};
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -22,9 +36,40 @@ in {
greetd.enableKwallet = true; greetd.enableKwallet = true;
}; };
services.xserver = { services.xserver = {
displayManager.sddm = { displayManager.sddm = let
sddm-sugar-dark-configured = pkgs.sddm-sugar-dark.override {
config = {
General = {
Background = "${cfg.sddm.backgroundImage}";
ScaleImageCropped = true;
ScreenWidth = builtins.toString cfg.sddm.screenWidth;
ScreenHeight = builtins.toString cfg.sddm.screenHeight;
MainColor = "navajowhite";
AccentColor = "white";
RoundCorners = 20;
ScreenPadding = 0;
Font = "Noto Sans";
FontSize = "";
Locale = "";
HourFormat = "HH:mm";
DataFormat = "dddd, d of MMMM";
ForceLastUser = true;
ForcePasswordFocus = true;
ForceHideCompletePassword = true;
ForceHideVirtualKeyboardButton = false;
HeaderText = "Welcome!";
};
};
};
in {
enable = true; enable = true;
autoNumlock = true; autoNumlock = true;
theme = "${sddm-sugar-dark-configured}/usr/share/sddm/themes/sugar-dark";
}; };
desktopManager.plasma5 = { desktopManager.plasma5 = {
enable = true; enable = true;
@ -51,7 +96,7 @@ in {
}; };
}; };
kwinrc = { kwinrc = lib.mkIf cfg.mobile.enable {
Plugins = { Plugins = {
"org.kde.phone.multitaskingEnabled" = "false"; "org.kde.phone.multitaskingEnabled" = "false";
"kwin4_effect_eyeonscreenEnabled" = "false"; "kwin4_effect_eyeonscreenEnabled" = "false";

View File

@ -57,8 +57,6 @@ in {
cfscrape = cfscrape; cfscrape = cfscrape;
}; };
sddm-sugar-dark = prev.callPackage ./sddm-sugar-dark {};
surface-control = prev.callPackage ./tools/system/surface-control {}; surface-control = prev.callPackage ./tools/system/surface-control {};
trackma = prev.callPackage ./tools/video/trackma {}; trackma = prev.callPackage ./tools/video/trackma {};
@ -88,4 +86,6 @@ in {
wayfire-firedecor = prev.callPackage applications/wayfire/firedecor { wayfire-firedecor = prev.callPackage applications/wayfire/firedecor {
wayfire = wayfire-master; wayfire = wayfire-master;
}; };
sddm-sugar-dark = prev.callPackage themes/sddm/sugar-dark {};
} }

View File

@ -0,0 +1,32 @@
{
fetchFromGitHub
, stdenv, formats
, config ? {}
}:
# This package works a bit differently as the config needs to be inside the package.
# Override with config set to the settings you want. See
# https://github.com/MarianArlt/sddm-sugar-dark/blob/master/theme.conf
let
iniFmt = formats.ini {};
configFile = iniFmt.generate "theme.conf" config;
in stdenv.mkDerivation rec {
pname = "sddm-sugar-dark";
version = "1.2";
src = fetchFromGitHub {
owner = "MarianArlt";
repo = "sddm-sugar-dark";
rev = "v${version}";
sha256 = "0gx0am7vq1ywaw2rm1p015x90b75ccqxnb1sz3wy8yjl27v82yhb";
};
dontBuild = true;
installPhase = ''
mkdir -p $out/usr/share/sddm/themes/sugar-dark
cp -r metadata.desktop Main.qml Background.jpg Components Assets $out/usr/share/sddm/themes/sugar-dark
ln -s ${configFile} $out/usr/share/sddm/themes/sugar-dark/theme.conf
'';
}