refactor(modules): organize module tree
This commit was merged in pull request #72.
This commit is contained in:
73
modules/desktop/utilities/theming.nix
Normal file
73
modules/desktop/utilities/theming.nix
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
# Nord theming for the graphical layer, driven from one base16 scheme by Stylix.
|
||||
let
|
||||
cfg = config.modules.desktop.utilities.theming;
|
||||
user = config.user.name;
|
||||
|
||||
# A single static Nord wallpaper, drawn as a vertical gradient across the
|
||||
# Polar Night shades so it needs no committed binary and no network fetch.
|
||||
wallpaper = pkgs.runCommand "nord-wallpaper.png" { } ''
|
||||
${pkgs.imagemagick}/bin/magick \
|
||||
-size 2560x1440 gradient:'#2E3440'-'#3B4252' \
|
||||
"$out"
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.modules.desktop.utilities.theming.enable =
|
||||
lib.mkEnableOption "Nord theming of the graphical layer via Stylix";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
stylix = {
|
||||
enable = true;
|
||||
|
||||
# Nord is a dark scheme.
|
||||
# The polarity steers Stylix's contrast choices.
|
||||
polarity = "dark";
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/nord.yaml";
|
||||
|
||||
image = wallpaper;
|
||||
|
||||
# Regreet is not enabled, so its styling target stays off.
|
||||
targets.regreet.enable = false;
|
||||
|
||||
cursor = {
|
||||
package = pkgs.bibata-cursors;
|
||||
# Solid white with a dark outline, so it stays easy to spot against the
|
||||
# dark Nord wallpaper.
|
||||
name = "Bibata-Modern-Ice";
|
||||
size = 24;
|
||||
};
|
||||
|
||||
fonts = {
|
||||
monospace = {
|
||||
package = pkgs.jetbrains-mono;
|
||||
name = "JetBrains Mono";
|
||||
};
|
||||
|
||||
# A step below Stylix's defaults (applications 12, desktop/popups 10,
|
||||
# terminal 12), which read oversized on this display.
|
||||
sizes = {
|
||||
applications = 10;
|
||||
desktop = 9;
|
||||
popups = 9;
|
||||
terminal = 10;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.users.${user} = {
|
||||
# Stylix drives the cursor through home-manager's pointer-cursor config,
|
||||
# whose generation must be switched on explicitly.
|
||||
home.pointerCursor.enable = true;
|
||||
|
||||
# nvim keeps its dedicated Nord colorscheme, which is richer than the
|
||||
# base16 mapping Stylix would apply, so its target stays off.
|
||||
stylix.targets.nixvim.enable = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user