fix: sddm theme

This commit is contained in:
danny 2025-10-16 21:20:21 +08:00
parent fc9b14e0d2
commit d273765b99
9 changed files with 65 additions and 106 deletions

View file

@ -4,7 +4,12 @@
}: }:
let let
inherit (pkgs) writeShellScript; inherit (pkgs) writeShellScript;
inherit (lib) replaceString optionalString; inherit (lib)
replaceString
optionalString
toUpper
substring
;
inherit (builtins) toJSON; inherit (builtins) toJSON;
in in
{ {
@ -91,4 +96,6 @@ in
// conf // conf
); );
}; };
capitalize = text: "${toUpper (substring 0 1 text)}${substring 1 (-1) text}";
} }

View file

@ -1,22 +1,27 @@
{ {
pkgs, pkgs,
osConfig,
helper,
... ...
}: }:
let let
inherit (osConfig.systemConf) username;
inherit (helper) capitalize;
zenNebula = pkgs.fetchFromGitHub { zenNebula = pkgs.fetchFromGitHub {
owner = "justadumbprsn"; owner = "justadumbprsn";
repo = "zen-nebula"; repo = "zen-nebula";
rev = "main"; rev = "main";
sha256 = "sha256-f4J5ob/apKhxERUSvXE8QHMMsKJCQFRoMSo/Pw4LgTg="; sha256 = "sha256-f4J5ob/apKhxERUSvXE8QHMMsKJCQFRoMSo/Pw4LgTg=";
}; };
profileName = capitalize username;
in in
{ {
programs.zen-browser = { programs.zen-browser = {
enable = true; enable = true;
profiles = { profiles = {
"Danny Profile" = { "${profileName} Profile" = {
default = true; default = true;
name = "Danny"; name = username;
settings = { settings = {
"zen.view.compact.should-enable-at-startup" = true; "zen.view.compact.should-enable-at-startup" = true;
"zen.widget.linux.transparency" = true; "zen.widget.linux.transparency" = true;

View file

@ -2,6 +2,7 @@
inputs, inputs,
system, system,
config, config,
pkgs,
helper, helper,
lib, lib,
... ...
@ -40,6 +41,12 @@ let
}; };
}; };
}; };
defaultSddmTheme = (
pkgs.sddm-astronaut.override {
embeddedTheme = "purple_leaves.conf";
}
);
in in
{ {
options.systemConf = { options.systemConf = {
@ -59,6 +66,19 @@ in
description = "Main username"; description = "Main username";
}; };
sddm = {
theme = mkOption {
type = types.str;
description = "sddm theme name";
default = "sddm-astronaut-theme";
};
package = mkOption {
type = types.package;
default = defaultSddmTheme;
description = "sddm theme package";
};
};
hyprland = { hyprland = {
enable = (mkEnableOption "Enable hyprland") // { enable = (mkEnableOption "Enable hyprland") // {
default = false; default = false;

View file

@ -1,33 +0,0 @@
{
pkgs,
lib,
stdenvNoCC,
themeConfig ? null,
}:
stdenvNoCC.mkDerivation {
name = "aerial-sddm-theme";
dontWrapQtApps = true;
src = pkgs.fetchFromGitHub {
owner = "3ximus";
repo = "aerial-sddm-theme";
rev = "484b52e";
sha256 = "sha256-YeJTdlnGV58MNB8VpjDrFuC3VNsh5SgTdZH63aLD6Xw=";
};
installPhase =
let
iniFormat = pkgs.formats.ini { };
configFile = iniFormat.generate "" { General = themeConfig; };
basePath = "$out/share/sddm/themes/sddm-aerial-theme";
in
''
mkdir -p ${basePath}
cp -r $src/* ${basePath}
''
+ lib.optionalString (themeConfig != null) ''
ln -sf ${configFile} ${basePath}/theme.conf.user
'';
}

View file

@ -1,15 +0,0 @@
{ pkgs }:
pkgs.stdenv.mkDerivation {
name = "astronaut-sddm-theme";
src = pkgs.fetchFromGitHub {
owner = "gpskwlkr";
repo = "sddm-astronaut-theme";
rev = "468a100460d5feaa701c2215c737b55789cba0fc";
sha256 = "1h20b7n6a4pbqnrj22y8v5gc01zxs58lck3bipmgkpyp52ip3vig";
};
installPhase = ''
mkdir -p $out
cp -R ./* $out/
'';
}

View file

@ -1,27 +0,0 @@
{
pkgs,
...
}:
let
imageLink = "https://images.unsplash.com/photo-1507090960745-b32f65d3113a?ixlib=rb-4.0.3&q=85&fm=jpg&crop=entropy&cs=srgb&dl=matteo-catanese-PI8Hk-3ZcCU-unsplash.jpg&w=2400";
image = pkgs.fetchurl {
url = imageLink;
sha256 = "sha256-y0avQR9I8u2m0JEe/lcfLgHUDF1TDN029511yC6PhQE=";
};
in
pkgs.stdenv.mkDerivation {
name = "sddm-theme";
src = pkgs.fetchFromGitHub {
owner = "MarianArlt";
repo = "sddm-sugar-dark";
rev = "ceb2c455663429be03ba62d9f898c571650ef7fe";
sha256 = "0153z1kylbhc9d12nxy9vpn0spxgrhgy36wy37pk6ysq7akaqlvy";
};
installPhase = ''
mkdir -p $out
cp -R ./* $out/
cd $out/
rm Background.jpg
cp -r ${image} $out/Background.jpg
'';
}

View file

@ -4,10 +4,12 @@
inputs, inputs,
pkgs, pkgs,
config, config,
helper,
lib, lib,
... ...
}: }:
let let
inherit (helper) capitalize;
username = "danny"; username = "danny";
in in
{ {
@ -20,16 +22,27 @@ in
monitors = [ monitors = [
{ {
desc = "ASUSTek COMPUTER INC ASUS VG32VQ1B 0x00002271"; desc = "ASUSTek COMPUTER INC ASUS VG32VQ1B 0x00002271";
output = "DP-6"; output = "DP-5";
props = "2560x1440@165, 0x0, 1"; props = "2560x1440@165, 0x0, 1";
} }
{ {
desc = "Acer Technologies XV272U V3 1322131231233"; desc = "Acer Technologies XV272U V3 1322131231233";
output = "DP-5"; output = "DP-6";
props = "2560x1440@180, -1440x-600, 1, transform, 1"; props = "2560x1440@180, -1440x-600, 1, transform, 1";
} }
]; ];
}; };
sddm.package = (
pkgs.sddm-astronaut.override {
embeddedTheme = "purple_leaves";
themeConfig = {
ScreenWidth = "2560";
ScreenHeight = "1440";
Font = "SF Pro Display Bold";
HeaderText = "Welcome, ${capitalize username}";
};
}
);
}; };
networking.firewall.allowedTCPPortRanges = [ networking.firewall.allowedTCPPortRanges = [

View file

@ -2,6 +2,7 @@
let let
inherit (lib) optionalString; inherit (lib) optionalString;
inherit (config.systemConf) username; inherit (config.systemConf) username;
inherit (config.systemConf.hyprland) monitors;
in in
{ {
home-manager.users."${username}" = { home-manager.users."${username}" = {
@ -20,7 +21,7 @@ in
settings = [ settings = [
# monitor 1 # monitor 1
{ {
output = "DP-6"; output = "${(builtins.elemAt monitors 0).output}";
height = 48; height = 48;
modules-left = [ modules-left = [
"custom/os" "custom/os"
@ -47,7 +48,7 @@ in
} }
# monitor 2 # monitor 2
{ {
output = "DP-5"; output = "${(builtins.elemAt monitors 1).output}";
height = 54; height = 54;
modules-left = [ modules-left = [
"clock" "clock"

View file

@ -1,31 +1,19 @@
{ pkgs, ... }: { pkgs, config, ... }:
let let
themeConfig = { inherit (config.systemConf.sddm) theme package;
bgVidDay = "playlist/day.m3u";
bgVidNight = "playlist/night.m3u";
};
in in
{ {
services = { services.displayManager.sddm = {
displayManager = { enable = true;
sddm.wayland.enable = true; wayland.enable = true;
sddm.enable = true; theme = theme;
sddm.theme = "${pkgs.callPackage ./../../pkgs/sddm-themes/gruvbox.nix { settings.Theme.Current = theme;
inherit pkgs themeConfig;
}}";
};
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs.kdePackages; [
# SDDM package
libsForQt5.qt5.qtmultimedia qtmultimedia
libsForQt5.qt5.qtquickcontrols2 qtbase
libsForQt5.qt5.qtgraphicaleffects qtwayland
libsForQt5.qt5.qtsvg
libsForQt5.qt5.qtwayland
pkgs.gst_all_1.gst-libav
pkgs.gst_all_1.gstreamer
pkgs.gst_all_1.gst-plugins-good
]; ];
} }