Merge branch 'danth:master' into simp1e

This commit is contained in:
Angelo Bulfone 2024-07-21 17:04:09 -07:00 committed by GitHub
commit 348b67929b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 102 additions and 42 deletions

View file

@ -62,7 +62,7 @@ The current scheme can be previewed in a web browser at either
### Handmade schemes
If you prefer a handmade color scheme, you can choose anything from
[the Tinted Theming repository](https://github.com/tinted-theming/base16-schemes):
[the Tinted Theming repository](https://github.com/tinted-theming/schemes):
```nix
{

View file

@ -53,11 +53,11 @@
"base16-helix": {
"flake": false,
"locked": {
"lastModified": 1696727917,
"narHash": "sha256-FVrbPk+NtMra0jtlC5oxyNchbm8FosmvXIatkRbYy1g=",
"lastModified": 1720809814,
"narHash": "sha256-numb3xigRGnr/deF7wdjBwVg7fpbTH7reFDkJ75AJkY=",
"owner": "tinted-theming",
"repo": "base16-helix",
"rev": "dbe1480d99fe80f08df7970e471fac24c05f2ddb",
"rev": "34f41987bec14c0f3f6b2155c19787b1f6489625",
"type": "github"
},
"original": {

View file

@ -219,53 +219,80 @@ let
printf '%s\n' "$kded5rc" >"$out/kded5rc"
printf '%s\n' "$kdeglobals" >"$out/kdeglobals"
'';
envVars = {
QT_QPA_PLATFORMTHEME = "kde";
QT_STYLE_OVERRIDE = "breeze";
};
in {
options.stylix.targets.kde.enable =
config.lib.stylix.mkEnableTarget "KDE" true;
config = lib.mkIf (config.stylix.enable && config.stylix.targets.kde.enable && pkgs.stdenv.hostPlatform.isLinux) {
home.packages = [ themePackage ];
xdg.systemDirs.config = [ "${configPackage}" ];
xdg = {
systemDirs.config = [ "${configPackage}" ];
configFile."kdeglobals".text = "${formatConfig colorscheme}";
};
# plasma-apply-wallpaperimage is necessary to change the wallpaper
# after the first login.
#
# plasma-apply-lookandfeel is only here to trigger a hot reload, the theme
# would still be applied without it if you logged out and back in.
#
# Home Manager clears $PATH before running the activation script, but we
# want to avoid installing these tools explicitly because that would pull
# in large dependencies for people who aren't actually using KDE.
# The workaround used is to assume a list of common paths where the tools
# might be installed, and look there. The ideal solution would require
# changes to KDE to make it possible to update the wallpaper through
# config files alone.
home.activation.stylixLookAndFeel = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
global_path() {
for directory in /run/current-system/sw/bin /usr/bin /bin; do
if [[ -f "$directory/$1" ]]; then
printf '%s\n' "$directory/$1"
return 0
fi
done
systemd.user.sessionVariables = envVars;
return 1
}
qt = {
enable = true;
};
if wallpaper_image="$(global_path plasma-apply-wallpaperimage)"; then
"$wallpaper_image" "${themePackage}/share/wallpapers/stylix"
else
verboseEcho \
"plasma-apply-wallpaperimage: command not found"
fi
home = {
packages = with pkgs; [
themePackage
if look_and_feel="$(global_path plasma-apply-lookandfeel)"; then
"$look_and_feel" --apply stylix
else
verboseEcho \
"Skipping plasma-apply-lookandfeel: command not found"
fi
'';
# QT6 packages (note that full does not mean "install all of KDE", just all of Qt6)
(hiPrio kdePackages.full)
(hiPrio kdePackages.breeze-icons)
(hiPrio kdePackages.breeze)
(hiPrio kdePackages.plasma-integration)
(hiPrio kdePackages.qqc2-breeze-style)
(hiPrio kdePackages.qqc2-desktop-style)
# QT5 packages
libsForQt5.full
libsForQt5.breeze-icons
libsForQt5.breeze-qt5
libsForQt5.qqc2-breeze-style
libsForQt5.qqc2-desktop-style
libsForQt5.plasma-integration
];
sessionVariables = envVars;
# plasma-apply-wallpaperimage is necessary to change the wallpaper
# after the first login.
#
# Home Manager clears $PATH before running the activation script, but we
# want to avoid installing these tools explicitly because that would pull
# in large dependencies for people who aren't actually using KDE.
# The workaround used is to assume a list of common paths where the tools
# might be installed, and look there. The ideal solution would require
# changes to KDE to make it possible to update the wallpaper through
# config files alone.
activation.stylixLookAndFeel = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
global_path() {
for directory in /run/current-system/sw/bin /usr/bin /bin; do
if [[ -f "$directory/$1" ]]; then
printf '%s\n' "$directory/$1"
return 0
fi
done
return 1
}
if wallpaper_image="$(global_path plasma-apply-wallpaperimage)"; then
"$wallpaper_image" "${themePackage}/share/wallpapers/stylix"
else
verboseEcho \
"plasma-apply-wallpaperimage: command not found"
fi
'';
};
};
}

33
modules/ncspot/hm.nix Normal file
View file

@ -0,0 +1,33 @@
{ config, lib, ... }:
{
options.stylix.targets.ncspot.enable =
config.lib.stylix.mkEnableTarget "Ncspot" true;
config = lib.mkIf (config.stylix.enable && config.stylix.targets.ncspot.enable) {
programs.ncspot.settings =
let
colors = config.lib.stylix.colors.withHashtag;
in {
theme = with colors; {
background = base00;
primary = base05;
secondary = base03;
title = base06;
playing = base05;
playing_selected = base06;
playing_bg = base02;
highlight = base05;
highlight_bg = base02;
error = base07;
error_bg = base0F;
statusbar = base00;
statusbar_progress = base04;
statusbar_bg = base04;
cmdline = base05;
cmdline_bg = base00;
search_match = base05;
};
};
};
}