Reorganized
This commit is contained in:
1 parent
c3c61ce654
commit
760815da50
145 files changed
-1444
No files matched your search
@@ -0,0 +1,164 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.waybar;
|
||||
theme = config.desktop.theming;
|
||||
colors = theme.colors;
|
||||
in
|
||||
{
|
||||
options.modules.waybar = {
|
||||
enable = mkEnableOption "waybar";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
pulsemixer
|
||||
playerctl
|
||||
networkmanagerapplet # TODO: Move
|
||||
];
|
||||
|
||||
modules.desktop.reloadScript = ''
|
||||
# if ${pkgs.procps}/bin/pgrep waybar; then
|
||||
# ${pkgs.procps}/bin/pkill waybar
|
||||
# fi
|
||||
${pkgs.waybar}/bin/waybar &
|
||||
'';
|
||||
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
systemd.enable = false;
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
spacing = 16;
|
||||
modules-left = [ "river/tags" ];
|
||||
modules-center = [
|
||||
#"river/window"
|
||||
"mpris"
|
||||
];
|
||||
modules-right = [
|
||||
"tray"
|
||||
"bluetooth"
|
||||
"network"
|
||||
"pulseaudio"
|
||||
"battery"
|
||||
"clock"
|
||||
];
|
||||
"river/window" = {
|
||||
max-length = 50;
|
||||
};
|
||||
"river/tags" = {
|
||||
tag-labels = [
|
||||
"一"
|
||||
"二"
|
||||
"三"
|
||||
"四"
|
||||
"五"
|
||||
"六"
|
||||
"七"
|
||||
"八"
|
||||
"九"
|
||||
];
|
||||
disable-click = false;
|
||||
};
|
||||
network = {
|
||||
tooltip = false;
|
||||
on-click = "wpa_gui";
|
||||
format-wifi = "直 {essid}"; # Spacing achieved using "Thin Space"
|
||||
format-ethernet = "TODO";
|
||||
format-disconnected = "睊";
|
||||
};
|
||||
pulseaudio = {
|
||||
tooltip = false;
|
||||
format = "{icon} {volume}%"; # Spacing achieved using "Thin Space"
|
||||
#format-muted = "";
|
||||
format-muted = "{icon} --%"; # Spacing achieved using "Thin Space"
|
||||
format-icons = {
|
||||
#headphone = "";
|
||||
#default = [ "" "" ];
|
||||
headphone = "";
|
||||
headphone-muted = "";
|
||||
default = [
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
};
|
||||
battery = {
|
||||
format = "{icon} {capacity}%"; # Spacing achieved using "Thin Space"
|
||||
format-charging = " {capacity}%"; # Spacing achieved using "Thin Space"
|
||||
#format-icons = [ "" "" "" "" "" "" "" "" "" "" "" ];
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
interval = 1;
|
||||
};
|
||||
clock = {
|
||||
#format = " {:%H:%M}";
|
||||
#format = " {:%H:%M}"; # Spacing achieved using "Thin Space"
|
||||
format = "{:%H:%M}";
|
||||
};
|
||||
mpris = {
|
||||
format = "{dynamic}";
|
||||
tooltip-format = "";
|
||||
interval = 1;
|
||||
};
|
||||
bluetooth = {
|
||||
tooltip = false;
|
||||
format = " {status}"; # Spacing achieved using "Thin Space"
|
||||
format-connected = " {device_alias}"; # Spacing achieved using "Thin Space"
|
||||
};
|
||||
};
|
||||
};
|
||||
# TODO: Replace base03 color with named color
|
||||
style = ''
|
||||
window#waybar {
|
||||
color: #${colors.fg};
|
||||
background-color: #${colors.bg};
|
||||
border-style: none none solid none;
|
||||
border-width: ${toString theme.layout.borderSize}px;
|
||||
border-color: #${colors.border-unfocused};
|
||||
font-size: 12px;
|
||||
font-family: "${theme.fonts.monospace.name}";
|
||||
}
|
||||
|
||||
.modules-right {
|
||||
margin: 0 8px 0 0;
|
||||
}
|
||||
|
||||
#tags button {
|
||||
color: #${theme.schemeColors.base03};
|
||||
padding: 0 5px 1px 5px;
|
||||
border-radius: 0;
|
||||
font-size: 16px;
|
||||
font-family: "wenquanyi bitmap song";
|
||||
}
|
||||
|
||||
#tags button.occupied {
|
||||
color: #${colors.fg};
|
||||
}
|
||||
|
||||
#tags button.focused {
|
||||
color: #${colors.accent};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
# Import desktop environment modules
|
||||
./bar/waybar.nix
|
||||
./lock-screen/waylock.nix
|
||||
./window-manager/river.nix
|
||||
];
|
||||
|
||||
options.modules.desktop = {
|
||||
wayland = mkEnableOption "wayland";
|
||||
# TODO: Find a nicer way to do this as this is also executed on startup
|
||||
reloadScript = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = "Shell script to execute after reload/rebuild.";
|
||||
};
|
||||
decorations = mkOption {
|
||||
type = types.nullOr (
|
||||
types.enum [
|
||||
"csd"
|
||||
"ssd"
|
||||
]
|
||||
);
|
||||
default = null;
|
||||
description = "Window decorations to use.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf config.desktop.enable (
|
||||
lib.recursiveUpdate
|
||||
{
|
||||
# Ensure desktop related systemd services (xdg) have access to session variables.
|
||||
systemd.user.sessionVariables = config.home.sessionVariables;
|
||||
|
||||
home.packages = optionals cfg.wayland (
|
||||
with pkgs;
|
||||
[
|
||||
wl-clipboard
|
||||
wtype
|
||||
grim
|
||||
slurp
|
||||
]
|
||||
);
|
||||
|
||||
home.activation = {
|
||||
customReloadScript = lib.hm.dag.entryAfter [ "writeBoundary" ] (
|
||||
''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
''
|
||||
+ cfg.reloadScript
|
||||
);
|
||||
};
|
||||
|
||||
# home.file.".initrc" = {
|
||||
# enable = true;
|
||||
# executable = true;
|
||||
# text =
|
||||
# ''
|
||||
# #!${pkgs.bash}/bin/bash
|
||||
|
||||
# ''
|
||||
# + cfg.initScript;
|
||||
# };
|
||||
}
|
||||
(
|
||||
# TODO: Move to dedicated module within desktop or maybe theming?
|
||||
# if cfg.decorations == null then
|
||||
# { }
|
||||
# else
|
||||
# {
|
||||
# csd = { };
|
||||
# ssd = { };
|
||||
# }
|
||||
# ."${cfg.decorations}"
|
||||
{ }
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.waylock;
|
||||
in
|
||||
{
|
||||
options.modules.waylock = {
|
||||
enable = mkEnableOption "waylock";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = (with pkgs; [ waylock ]);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,268 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.modules.river;
|
||||
in
|
||||
{
|
||||
options.modules.river.enable = lib.mkEnableOption "river";
|
||||
|
||||
# osConfig = lib.mkIf cfg.enable {
|
||||
# programs.river.enable = true;
|
||||
# };
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Set desktop type to wayland
|
||||
modules.desktop.wayland = true;
|
||||
|
||||
# TODO: Move elsewhere and make keybindings more configurable
|
||||
modules.rofi.enable = true;
|
||||
|
||||
# TODO: Move elsewhere
|
||||
home.packages = with pkgs; [
|
||||
brightnessctl
|
||||
river-filtile
|
||||
# owm
|
||||
|
||||
udiskie # TODO: Move to USB module
|
||||
];
|
||||
|
||||
# Change desktop to execute river
|
||||
desktop.initScript = ''
|
||||
${pkgs.river}/bin/river
|
||||
'';
|
||||
|
||||
desktop.session.type = "wayland";
|
||||
desktop.session.desktop = "river";
|
||||
|
||||
# TODO: Fix this
|
||||
# modules.desktop.reloadScript = ''
|
||||
# ${pkgs.river}/bin/riverctl background-color 0x${config.theming.colors.bg}
|
||||
# '';
|
||||
|
||||
# Update background after rebuild
|
||||
# home.activation = {
|
||||
# river = lib.hm.dag.entryBetween [ "reloadSystemd" ] [ "installPackages" ] ''
|
||||
# # Close waybar
|
||||
# PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill waybar
|
||||
|
||||
# # Kill rivertile
|
||||
# PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill rivertile
|
||||
|
||||
# # Kill glpaper
|
||||
# PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill glpaper
|
||||
|
||||
# # Restart river
|
||||
# PATH="${pkgs.river}/bin:${pkgs.systemd}/bin:${pkgs.waybar}/bin:$PATH" $DRY_RUN_CMD ~/.config/river/init
|
||||
# '';
|
||||
# };
|
||||
|
||||
# River setup
|
||||
wayland.windowManager.river = {
|
||||
enable = true;
|
||||
xwayland.enable = false;
|
||||
systemd.enable = true;
|
||||
settings =
|
||||
let
|
||||
layout = "filtile";
|
||||
layoutOptions = "-outer-padding ${toString config.desktop.theming.layout.windowPadding} -view-padding ${toString config.desktop.theming.layout.windowPadding} -main-ratio 0.5";
|
||||
modes = [
|
||||
"normal"
|
||||
"locked"
|
||||
];
|
||||
tags = [
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
];
|
||||
waylockOptions = "-init-color 0x${colors.bg} -input-color 0x${colors.border-focused} -fail-color 0x${colors.bg}";
|
||||
|
||||
colors = config.desktop.theming.colors;
|
||||
|
||||
# Quick pow function
|
||||
pow2 = power: if power != 0 then 2 * (pow2 (power - 1)) else 1;
|
||||
|
||||
# Modifiers
|
||||
main = "Super";
|
||||
ssm = "Super+Shift";
|
||||
sas = "Super+Alt+Shift";
|
||||
sam = "Super+Alt";
|
||||
scm = "Super+Control";
|
||||
scam = "Super+Control+Alt";
|
||||
ssc = "Super+Shift+Control";
|
||||
in
|
||||
{
|
||||
default-layout = "${layout}";
|
||||
set-repeat = "50 300";
|
||||
xcursor-theme = "BreezeX-RosePine-Linux 24";
|
||||
keyboard-layout = "-options \"caps:escape\" us";
|
||||
|
||||
border-width = toString config.desktop.theming.layout.borderSize;
|
||||
background-color = "0x${colors.bg}";
|
||||
border-color-focused = "0x${colors.fg}";
|
||||
border-color-unfocused = "0x${colors.border-unfocused}"; # TODO: Change to use named color;
|
||||
border-color-urgent = "0x${colors.fg}";
|
||||
|
||||
# TODO: Make a desktop options for DE applications
|
||||
spawn = [
|
||||
"\"${layout} ${layoutOptions}\""
|
||||
"waybar" # TODO: Decouple
|
||||
# TODO: Generic background options
|
||||
# "\"glpaper eDP-1 ${toString config.modules.glpaper.shader}\""
|
||||
"udiskie"
|
||||
# TODO: Should this be part of the keyring configuration directly?
|
||||
# "\"gnome-keyring-daemon --replace --components=pkcs11,secrets,ssh\""
|
||||
"wpaperd"
|
||||
];
|
||||
map = (
|
||||
lib.attrsets.recursiveUpdate
|
||||
{
|
||||
"-repeat".normal = {
|
||||
# Basic utilities
|
||||
"${main} Q" = "close";
|
||||
"${ssm} Return" = "spawn foot";
|
||||
|
||||
# Window focus
|
||||
"${main} J" = "focus-view next";
|
||||
"${main} K" = "focus-view previous";
|
||||
|
||||
# Swap windows
|
||||
"${ssm} J" = "swap next";
|
||||
"${ssm} K" = "swap previous";
|
||||
"${main} Return" = "zoom";
|
||||
|
||||
# Main ratio
|
||||
"${main} H" = "send-layout-cmd ${layout} 'main-ratio -0.05'";
|
||||
"${main} L" = "send-layout-cmd ${layout} 'main-ratio +0.05'";
|
||||
|
||||
# Main count
|
||||
"${ssm} H" = "send-layout-cmd ${layout} 'main-count +1'";
|
||||
"${ssm} L" = "send-layout-cmd ${layout} 'main-count -1'";
|
||||
|
||||
# Move floating windows
|
||||
"${sam} H" = "move left 100";
|
||||
"${sam} J" = "move down 100";
|
||||
"${sam} K" = "move up 100";
|
||||
"${sam} L" = "move right 100";
|
||||
|
||||
# Resize floating windows
|
||||
"${sas} H" = "resize horizontal -100";
|
||||
"${sas} J" = "resize vertical 100";
|
||||
"${sas} K" = "resize vertical -100";
|
||||
"${sas} L" = "resize horizontal 100";
|
||||
|
||||
# Toggle modes
|
||||
"${main} Space" = "toggle-float";
|
||||
"${main} F" = "toggle-fullscreen";
|
||||
};
|
||||
normal =
|
||||
{
|
||||
# Basic utilities
|
||||
"${ssm} E" = "exit";
|
||||
"${main} X " = "spawn \"waylock -fork-on-lock ${waylockOptions}\"";
|
||||
"${main} P" = "spawn \"rofi -show drun\"";
|
||||
"${ssm} P" = "spawn rofi-rbw";
|
||||
"${main} S" =
|
||||
"spawn \"grim -g \\\"\\\$(slurp)\\\" ~/Images/Screenshots/\\\$(date +'%s_grim.png')\"";
|
||||
|
||||
# Tags
|
||||
"${main} 0" = "set-focused-tags ${toString (pow2 32 - 1)}";
|
||||
"${ssm} 0" = "set-view-tags ${toString (pow2 32 - 1)}";
|
||||
|
||||
# Orientation
|
||||
"${main} Up" = "send-layout-cmd ${layout} \"main-location top\"";
|
||||
"${main} Right" = "send-layout-cmd ${layout} \"main-location right\"";
|
||||
"${main} Down" = "send-layout-cmd ${layout} \"main-location bottom\"";
|
||||
"${main} Left" = "send-layout-cmd ${layout} \"main-location left\"";
|
||||
|
||||
# Snap floating windows
|
||||
"${scam} H" = "snap left";
|
||||
"${scam} J" = "snap down";
|
||||
"${scam} K" = "snap up";
|
||||
"${scam} L" = "snap right";
|
||||
}
|
||||
// builtins.listToAttrs (
|
||||
builtins.concatLists (
|
||||
map (tag: [
|
||||
{
|
||||
name = "${main} ${toString tag}";
|
||||
value = "set-focused-tags ${toString (pow2 (tag - 1))}";
|
||||
}
|
||||
{
|
||||
name = "${ssm} ${toString tag}";
|
||||
value = "set-view-tags ${toString (pow2 (tag - 1))}";
|
||||
}
|
||||
{
|
||||
name = "${scm} ${toString tag}";
|
||||
value = "toggle-focused-tags ${toString (pow2 (tag - 1))}";
|
||||
}
|
||||
{
|
||||
name = "${ssc} ${toString tag}";
|
||||
value = "toggle-view-tags ${toString (pow2 (tag - 1))}";
|
||||
}
|
||||
]) tags
|
||||
)
|
||||
);
|
||||
}
|
||||
(
|
||||
builtins.listToAttrs (
|
||||
map (mode: {
|
||||
name = "${mode}";
|
||||
value = {
|
||||
# Control volume
|
||||
"None XF86AudioRaiseVolume" = "spawn \"pulsemixer --change-volume +5\"";
|
||||
"None XF86AudioLowerVolume" = "spawn \"pulsemixer --change-volume -5\"";
|
||||
"None XF86AudioMute" = "spawn \"pulsemixer --toggle-mute\"";
|
||||
|
||||
# Control brightness
|
||||
"None XF86MonBrightnessUp" = "spawn \"brightnessctl set +5%\"";
|
||||
"None XF86MonBrightnessDown" = "spawn \"brightnessctl set 5%-\"";
|
||||
|
||||
# Control music playback
|
||||
"None XF86Messenger" = "spawn \"playerctl previous\"";
|
||||
"None XF86Go" = "spawn \"playerctl play-pause\"";
|
||||
"None Cancel" = "spawn \"playerctl next\"";
|
||||
};
|
||||
}) modes
|
||||
)
|
||||
)
|
||||
);
|
||||
map-pointer = {
|
||||
normal = {
|
||||
"${main} BTN_LEFT" = "move-view";
|
||||
"${main} BTN_RIGHT" = "resize-view";
|
||||
"${main} BTN_MIDDLE" = "toggle-float";
|
||||
};
|
||||
};
|
||||
input = {
|
||||
"'*'" = {
|
||||
accel-profile = "adaptive";
|
||||
pointer-accel = "0.5";
|
||||
scroll-factor = "0.8";
|
||||
};
|
||||
"'*Synaptics*'" = {
|
||||
natural-scroll = "enabled";
|
||||
};
|
||||
};
|
||||
rule-add = {
|
||||
"-app-id" = {
|
||||
"'bar'" = "csd";
|
||||
"'*'" = "ssd";
|
||||
"'wpa_gui'" = "float";
|
||||
"'Xpra'" = "float";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
# Desktop configuration module
|
||||
desktopConfigurationModule = types.submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
description = "Desktop environment name.";
|
||||
};
|
||||
type = mkOption {
|
||||
type = types.enum [
|
||||
"custom"
|
||||
"gnome"
|
||||
];
|
||||
description = "Desktop environment type.";
|
||||
};
|
||||
config = mkOption {
|
||||
type = types.attrs;
|
||||
default = { };
|
||||
description = "Desktop environment configuration";
|
||||
};
|
||||
extraConfig = mkOption {
|
||||
type = types.attrs;
|
||||
default = { };
|
||||
description = "Extra configuration for the configured desktop environment";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
customBuilder =
|
||||
config:
|
||||
recursiveUpdate {
|
||||
desktop.name = config.name;
|
||||
} config.extraConfig;
|
||||
|
||||
# Environment builders
|
||||
environmentBuilders = {
|
||||
custom = customBuilder;
|
||||
};
|
||||
|
||||
cfg = config.desktop;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./custom/default.nix
|
||||
./theming/default.nix
|
||||
];
|
||||
|
||||
options.desktop = {
|
||||
enable = mkEnableOption "desktop";
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
default = "Shell";
|
||||
description = "Desktop configuration name.";
|
||||
};
|
||||
initScript = mkOption {
|
||||
type = types.lines;
|
||||
default = ''
|
||||
${pkgs.ncurses}/bin/clear
|
||||
${pkgs.bashInteractive}/bin/bash
|
||||
'';
|
||||
description = "Bash script to execute after logging in.";
|
||||
};
|
||||
session = {
|
||||
type = mkOption {
|
||||
type = types.enum [
|
||||
"wayland"
|
||||
"x11"
|
||||
"tty"
|
||||
];
|
||||
default = "tty";
|
||||
description = "Session type.";
|
||||
};
|
||||
desktop = mkOption {
|
||||
type = types.str;
|
||||
default = "tty";
|
||||
description = "Desktop environment name.";
|
||||
};
|
||||
};
|
||||
environments = mkOption {
|
||||
type = types.attrsOf desktopConfigurationModule;
|
||||
default = { };
|
||||
description = "Desktop environments. Every environment will be built as a specialization.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
specialisation = mapAttrs (name: value: {
|
||||
configuration = (environmentBuilders."${value.type}" value);
|
||||
}) cfg.environments;
|
||||
|
||||
# Create session files
|
||||
home.extraBuilderCommands = ''
|
||||
mkdir $out/session
|
||||
echo "${cfg.name}" > $out/session/name
|
||||
ln -s ${
|
||||
pkgs.writeTextFile {
|
||||
name = "desktop-init";
|
||||
text =
|
||||
''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
|
||||
''
|
||||
+ cfg.initScript;
|
||||
executable = true;
|
||||
}
|
||||
} $out/session/init
|
||||
ln -s ${
|
||||
pkgs.writeTextFile {
|
||||
name = "session-env";
|
||||
text = ''
|
||||
XDG_SESSION_TYPE=${cfg.session.type}
|
||||
XDG_CURRENT_DESKTOP=${cfg.session.desktop}
|
||||
XDG_SESSION_DESKTOP=${cfg.session.desktop}
|
||||
'';
|
||||
}
|
||||
} $out/session/env
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
waylock = {
|
||||
security.pam.services.waylock = { };
|
||||
};
|
||||
river = {
|
||||
programs.river.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.desktop.theming.background;
|
||||
in
|
||||
{
|
||||
options.desktop.theming.background = {
|
||||
image = {
|
||||
url = mkOption {
|
||||
type = types.str;
|
||||
default = "https://raw.githubusercontent.com/dharmx/walls/refs/heads/main/digital/a_drawing_of_a_spider_on_a_white_surface.png";
|
||||
description = "URL to the background image.";
|
||||
};
|
||||
hash = mkOption {
|
||||
type = types.str;
|
||||
default = "sha256-eCEjM7R9yeHNhZZtvHjrgkfwT25JA7FeMoVwnQ887CQ=";
|
||||
description = "SHA256 hash of the background image.";
|
||||
};
|
||||
};
|
||||
themed = mkEnableOption "themed background";
|
||||
inverted = mkEnableOption "invert background";
|
||||
};
|
||||
|
||||
config =
|
||||
with pkgs;
|
||||
let
|
||||
src = pkgs.fetchurl {
|
||||
url = cfg.image.url;
|
||||
hash = cfg.image.hash;
|
||||
};
|
||||
|
||||
theme = writeTextFile {
|
||||
name = "gowall-theme";
|
||||
text = builtins.toJSON {
|
||||
name = "NixOS";
|
||||
colors =
|
||||
let
|
||||
colors = config.desktop.theming.schemeColors;
|
||||
in
|
||||
[
|
||||
"#${colors.base00}"
|
||||
"#${colors.base01}"
|
||||
"#${colors.base02}"
|
||||
"#${colors.base03}"
|
||||
"#${colors.base04}"
|
||||
"#${colors.base05}"
|
||||
"#${colors.base06}"
|
||||
"#${colors.base07}"
|
||||
"#${colors.base08}"
|
||||
"#${colors.base09}"
|
||||
"#${colors.base0A}"
|
||||
"#${colors.base0B}"
|
||||
"#${colors.base0C}"
|
||||
"#${colors.base0D}"
|
||||
"#${colors.base0E}"
|
||||
"#${colors.base0F}"
|
||||
];
|
||||
};
|
||||
executable = true;
|
||||
};
|
||||
|
||||
fileExtension =
|
||||
name:
|
||||
let
|
||||
parts = splitString "." name;
|
||||
in
|
||||
if length parts > 1 then lists.last parts else "";
|
||||
|
||||
fileName =
|
||||
name:
|
||||
let
|
||||
parts = splitString "/" name;
|
||||
in
|
||||
if length parts > 1 then lists.last parts else name;
|
||||
|
||||
image = fileName cfg.image.url;
|
||||
|
||||
background-themed = stdenv.mkDerivation {
|
||||
name = "background-themed-1.0.0";
|
||||
src = src;
|
||||
|
||||
buildInputs = [
|
||||
gowall
|
||||
imagemagick
|
||||
(writeShellScriptBin "xdg-open" "")
|
||||
tree
|
||||
];
|
||||
|
||||
unpackPhase = ''
|
||||
cp ${src} ./${image}
|
||||
chmod u+w ./${image}
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
${optionalString cfg.inverted ''
|
||||
convert ./${image} -channel RGB -negate ./${image}
|
||||
''}
|
||||
${optionalString cfg.themed ''
|
||||
cp ${theme} ./theme.json
|
||||
|
||||
export HOME=$PWD
|
||||
|
||||
gowall convert ./${image} --output themed -t ./theme.json
|
||||
tree
|
||||
mv ./themed/*.* ./
|
||||
''}
|
||||
mv ./${image} themed.${fileExtension image}
|
||||
${optionalString (fileExtension image != "png") ''
|
||||
mogrify -format png themed.*
|
||||
''}
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
install -Dm644 -t $out themed.png
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
services.wpaperd = {
|
||||
enable = true;
|
||||
settings.default = {
|
||||
path = "${background-themed}/";
|
||||
mode = "center";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.desktop.theming;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
# Import all themes
|
||||
./themes/catppuccin.nix
|
||||
./themes/gruvbox.nix
|
||||
./themes/oxocarbon.nix
|
||||
./themes/papercolor.nix
|
||||
./themes/sakura.nix
|
||||
./themes/nord.nix
|
||||
];
|
||||
|
||||
options.desktop.theming =
|
||||
let
|
||||
colors = config.desktop.theming.schemeColors;
|
||||
in
|
||||
{
|
||||
darkMode = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether the app should use dark mode.";
|
||||
};
|
||||
|
||||
colorScheme = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
|
||||
description = "Base 16 color scheme to use for styling. See stylix documentation for more information.";
|
||||
};
|
||||
|
||||
schemeColors = mkOption {
|
||||
type = types.attrsOf types.anything;
|
||||
default = config.lib.stylix.colors;
|
||||
description = "Generated colors from scheme";
|
||||
};
|
||||
|
||||
colors = {
|
||||
bg = mkOption {
|
||||
type = types.str;
|
||||
default = colors.base00;
|
||||
};
|
||||
fg = mkOption {
|
||||
type = types.str;
|
||||
default = colors.base05;
|
||||
};
|
||||
bg-status = mkOption {
|
||||
type = types.str;
|
||||
default = colors.base01;
|
||||
};
|
||||
fg-status = mkOption {
|
||||
type = types.str;
|
||||
default = colors.base04;
|
||||
};
|
||||
bg-selection = mkOption {
|
||||
type = types.str;
|
||||
default = colors.base02;
|
||||
};
|
||||
bg-highlight = mkOption {
|
||||
type = types.str;
|
||||
default = colors.base03;
|
||||
};
|
||||
fg-search = mkOption {
|
||||
type = types.str;
|
||||
default = colors.base0A;
|
||||
};
|
||||
accent = mkOption {
|
||||
type = types.str;
|
||||
default = colors.base0E;
|
||||
};
|
||||
border-focused = mkOption {
|
||||
type = types.str;
|
||||
default = cfg.colors.fg;
|
||||
};
|
||||
border-unfocused = mkOption {
|
||||
type = types.str;
|
||||
default = cfg.colors.bg-selection;
|
||||
};
|
||||
};
|
||||
|
||||
colorsCSS = mkOption {
|
||||
type = types.lines;
|
||||
default =
|
||||
":root {\n"
|
||||
+ concatStrings (
|
||||
map (color: " --nix-color-${color.name}: #${color.value};\n") (attrsToList cfg.colors)
|
||||
)
|
||||
+ "}\n\n";
|
||||
description = "Colors as css variables";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
# Configure gnome theme
|
||||
dconf.settings = mkIf config.desktop.enable {
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = if cfg.darkMode then "prefer-dark" else "prefer-light";
|
||||
};
|
||||
};
|
||||
|
||||
# Configure qt theme
|
||||
qt = mkIf config.desktop.enable {
|
||||
enable = true;
|
||||
platformTheme.name = "gtk";
|
||||
style = {
|
||||
name = if cfg.darkMode then "adwaita-dark" else "adwaita-light";
|
||||
package = pkgs.adwaita-qt;
|
||||
};
|
||||
};
|
||||
|
||||
# Configure gtk theme
|
||||
gtk = mkIf config.desktop.enable {
|
||||
enable = true;
|
||||
theme = {
|
||||
name = if cfg.darkMode then "Adwaita-dark" else "Adwaita-light";
|
||||
package = pkgs.gnome-themes-extra;
|
||||
};
|
||||
};
|
||||
|
||||
# TODO: This should just straight up not be here
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
modules.git.ignores = [
|
||||
".direnv"
|
||||
];
|
||||
|
||||
# Enable stylix
|
||||
# TODO: Move to own module
|
||||
stylix = {
|
||||
enable = true;
|
||||
autoEnable = false;
|
||||
|
||||
targets = {
|
||||
foot.enable = true;
|
||||
nixvim.enable = true;
|
||||
qutebrowser.enable = true;
|
||||
vscode = {
|
||||
enable = true;
|
||||
profileNames = [ "default" ];
|
||||
};
|
||||
zathura.enable = true;
|
||||
};
|
||||
|
||||
base16Scheme = cfg.colorScheme;
|
||||
polarity = if cfg.darkMode then "dark" else "light";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,241 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.desktop.theming;
|
||||
|
||||
# Font module type
|
||||
fontModule = types.submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
description = "Font family name.";
|
||||
};
|
||||
package = mkOption {
|
||||
type = types.anything;
|
||||
description = "Font package";
|
||||
};
|
||||
recommendedSize = mkOption {
|
||||
type = types.nullOr types.int;
|
||||
default = null;
|
||||
description = "Recommended size for displaying this font.";
|
||||
};
|
||||
fallbackFonts = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
description = "Fallback fonts for specified font.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fontModules = [
|
||||
# Import all fonts
|
||||
./fonts/adwaita-mono.nix
|
||||
./fonts/adwaita-sans.nix
|
||||
./fonts/cozette-vector.nix
|
||||
./fonts/cozette.nix
|
||||
./fonts/dejavu-sans.nix
|
||||
./fonts/dejavu-serif.nix
|
||||
./fonts/dina.nix
|
||||
./fonts/fira-code.nix
|
||||
./fonts/nerd-fonts-symbols.nix
|
||||
./fonts/noto-color-emoji.nix
|
||||
./fonts/wqy-bitmapsong.nix
|
||||
./fonts/wqy-microhei-mono.nix
|
||||
./fonts/wqy-microhei.nix
|
||||
./fonts/wqy-zenhei-mono.nix
|
||||
./fonts/wqy-zenhei-sharp.nix
|
||||
./fonts/wqy-zenhei.nix
|
||||
];
|
||||
|
||||
# Gather enabled fonts.
|
||||
enabledFonts = [
|
||||
cfg.fonts.serif.name
|
||||
cfg.fonts.sansSerif.name
|
||||
cfg.fonts.monospace.name
|
||||
cfg.fonts.emoji.name
|
||||
] ++ map (font: font.name) cfg.fonts.extraFonts;
|
||||
|
||||
# Flatten dependencies of fonts
|
||||
fontPackages =
|
||||
converge
|
||||
(
|
||||
fonts:
|
||||
listToAttrs (
|
||||
map
|
||||
(font: {
|
||||
name = font;
|
||||
value = true;
|
||||
})
|
||||
(
|
||||
flatten (map (font: [ font.name ] ++ cfg.fonts.pkgs.${font.name}.fallbackFonts) (attrsToList fonts))
|
||||
)
|
||||
)
|
||||
)
|
||||
(
|
||||
listToAttrs (
|
||||
map (font: {
|
||||
name = font;
|
||||
value = true;
|
||||
}) enabledFonts
|
||||
)
|
||||
);
|
||||
|
||||
# Convert set of fonts to list of packages
|
||||
fontNameList = map (font: font.name) (attrsToList fontPackages);
|
||||
fontPackageList = map (font: cfg.fonts.pkgs.${font}.package) fontNameList;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./background.nix
|
||||
./colors.nix
|
||||
];
|
||||
|
||||
options.desktop.theming = {
|
||||
layout = {
|
||||
borderRadius = mkOption {
|
||||
type = types.int;
|
||||
default = 0;
|
||||
description = "Border radius of windows.";
|
||||
};
|
||||
|
||||
borderSize = mkOption {
|
||||
type = types.int;
|
||||
default = 1;
|
||||
description = "Size of borders used throughout UI.";
|
||||
};
|
||||
|
||||
windowPadding = mkOption {
|
||||
type = types.int;
|
||||
default = 2;
|
||||
description = "Margin of each window, actual space between windows will be twice this number.";
|
||||
};
|
||||
};
|
||||
|
||||
fonts = {
|
||||
pkgs = mkOption {
|
||||
type = types.attrsOf fontModule;
|
||||
default = builtins.listToAttrs (
|
||||
map (module: {
|
||||
name = module.name;
|
||||
value = module;
|
||||
}) (map (module: (import module) { inherit lib config pkgs; }) fontModules)
|
||||
);
|
||||
description = "All available font modules.";
|
||||
};
|
||||
|
||||
installed = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = fontNameList;
|
||||
description = "List of installed fonts.";
|
||||
};
|
||||
|
||||
serif = mkOption {
|
||||
type = fontModule;
|
||||
description = "Default serif font";
|
||||
};
|
||||
|
||||
sansSerif = mkOption {
|
||||
type = fontModule;
|
||||
description = "Default sansSerif font.";
|
||||
};
|
||||
|
||||
monospace = mkOption {
|
||||
type = fontModule;
|
||||
description = "Default monospace font.";
|
||||
};
|
||||
|
||||
emoji = mkOption {
|
||||
type = fontModule;
|
||||
description = "Default emoji font.";
|
||||
};
|
||||
|
||||
interface = mkOption {
|
||||
type = fontModule;
|
||||
description = "Default emoji font.";
|
||||
};
|
||||
|
||||
extraFonts = mkOption {
|
||||
type = types.listOf fontModule;
|
||||
default = [ ];
|
||||
description = "Additional fonts to install.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf config.desktop.enable {
|
||||
# Enable fontconfig
|
||||
modules.fontconfig.enable = true;
|
||||
|
||||
# Install configured fonts
|
||||
home.packages = fontPackageList;
|
||||
|
||||
# Configure gtk theme
|
||||
gtk =
|
||||
let
|
||||
disableCSD = ''
|
||||
headerbar.default-decoration {
|
||||
margin-bottom: 50px;
|
||||
margin-top: -100px;
|
||||
}
|
||||
window.csd,
|
||||
window.csd decoration {
|
||||
box-shadow: none;
|
||||
}
|
||||
'';
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
# TODO: Toggles
|
||||
gtk3.extraCss = mkIf config.modules.river.enable disableCSD;
|
||||
gtk4.extraCss = mkIf config.modules.river.enable disableCSD;
|
||||
};
|
||||
|
||||
# TODO: Make cursors configurable using modules.
|
||||
home.pointerCursor = {
|
||||
gtk.enable = true;
|
||||
name = lib.mkForce "BreezeX-RosePine-Linux";
|
||||
package = lib.mkForce pkgs.rose-pine-cursor;
|
||||
size = lib.mkForce 24;
|
||||
x11 = {
|
||||
defaultCursor = lib.mkForce "BreezeX-RosePine-Linux";
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Enable stylix
|
||||
# TODO: Move to own module
|
||||
stylix = {
|
||||
fonts = {
|
||||
serif = getAttrs [
|
||||
"name"
|
||||
"package"
|
||||
] cfg.fonts.serif;
|
||||
sansSerif = getAttrs [
|
||||
"name"
|
||||
"package"
|
||||
] cfg.fonts.sansSerif;
|
||||
monospace = getAttrs [
|
||||
"name"
|
||||
"package"
|
||||
] cfg.fonts.monospace;
|
||||
emoji = getAttrs [
|
||||
"name"
|
||||
"package"
|
||||
] cfg.fonts.emoji;
|
||||
|
||||
sizes = {
|
||||
applications = mkDefault cfg.fonts.serif.recommendedSize;
|
||||
desktop = mkDefault cfg.fonts.monospace.recommendedSize; # TODO: See below
|
||||
popups = mkDefault cfg.fonts.monospace.recommendedSize; # TODO: Add dedicated UI font
|
||||
terminal = mkDefault cfg.fonts.monospace.recommendedSize;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
name = "Adwaita Mono";
|
||||
package = pkgs.adwaita-fonts;
|
||||
recommendedSize = 12;
|
||||
fallbackFonts = [ ];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
name = "Adwaita Sans";
|
||||
package = pkgs.adwaita-fonts;
|
||||
recommendedSize = 12;
|
||||
fallbackFonts = [ ];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
name = "Cozette Vector";
|
||||
package = pkgs.cozette;
|
||||
recommendedSize = 9;
|
||||
fallbackFonts = [ ];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
name = "Cozette";
|
||||
package = pkgs.cozette;
|
||||
recommendedSize = 9;
|
||||
fallbackFonts = [ "Cozette Vector" ];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
name = "DejaVu Sans";
|
||||
package = pkgs.dejavu_fonts;
|
||||
recommendedSize = 12;
|
||||
fallbackFonts = [ ];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
name = "DejaVu Serif";
|
||||
package = pkgs.dejavu_fonts;
|
||||
recommendedSize = 12;
|
||||
fallbackFonts = [ ];
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
name = "Dina";
|
||||
package = pkgs.dina-font;
|
||||
recommendedSize = 9;
|
||||
fallbackFonts = [
|
||||
"Cozette"
|
||||
"wenquanyi bitmap song"
|
||||
"Symbols Nerd Font Mono"
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
name = "Fira Code";
|
||||
package = pkgs.fira-code;
|
||||
recommendedSize = 12;
|
||||
fallbackFonts = [ "Symbols Nerd Font Mono" ];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
name = "Symbols Nerd Font Mono";
|
||||
package = pkgs.nerd-fonts.symbols-only;
|
||||
recommendedSize = 12;
|
||||
fallbackFonts = [ ];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
name = "Noto Color Emoji";
|
||||
package = pkgs.noto-fonts-color-emoji;
|
||||
recommendedSize = 12;
|
||||
fallbackFonts = [ ];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
name = "wenquanyi bitmap song";
|
||||
package = pkgs.wqy-bitmapsong;
|
||||
recommendedSize = 12;
|
||||
fallbackFonts = [ ];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
name = "WenQuanYi Micro Hei Mono";
|
||||
package = pkgs.wqy-microhei;
|
||||
recommendedSize = 12;
|
||||
fallbackFonts = [ ];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
name = "WenQuanYi Micro Hei";
|
||||
package = pkgs.wqy-microhei;
|
||||
recommendedSize = 12;
|
||||
fallbackFonts = [ ];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
name = "WenQuanYi Zen Hei Mono";
|
||||
package = pkgs.wqy-zenhei;
|
||||
recommendedSize = 12;
|
||||
fallbackFonts = [ ];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
name = "WenQuanYi Zen Hei Sharp";
|
||||
package = pkgs.wqy-zenhei;
|
||||
recommendedSize = 12;
|
||||
fallbackFonts = [ ];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
name = "WenQuanYi Zen Hei";
|
||||
package = pkgs.wqy-zenhei;
|
||||
recommendedSize = 12;
|
||||
fallbackFonts = [ ];
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.desktop.theming.themes.catppuccin;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
desktop.theming.themes.catppuccin = {
|
||||
enable = mkEnableOption "catppuccin";
|
||||
flavor = mkOption {
|
||||
type = types.enum [
|
||||
"latte"
|
||||
"frappe"
|
||||
"macchiato"
|
||||
"mocha"
|
||||
];
|
||||
default = "mocha";
|
||||
description = "The flavor of catppuccin theme.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config.desktop.theming = mkIf cfg.enable {
|
||||
darkMode = (cfg.flavor != "latte");
|
||||
colorScheme = "${pkgs.base16-schemes}/share/themes/catppuccin-${cfg.flavor}.yaml";
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.desktop.theming.themes.gruvbox;
|
||||
mode = if cfg.darkMode then "dark" else "light";
|
||||
in
|
||||
{
|
||||
options = {
|
||||
desktop.theming.themes.gruvbox = {
|
||||
enable = mkEnableOption "gruvbox-hard";
|
||||
darkMode = mkEnableOption "dark mode";
|
||||
contrast = mkOption {
|
||||
type = types.enum [
|
||||
"hard"
|
||||
"medium"
|
||||
"soft"
|
||||
];
|
||||
default = "hard";
|
||||
description = "The contrast level of the theme.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config.desktop.theming = mkIf cfg.enable {
|
||||
darkMode = cfg.darkMode;
|
||||
colorScheme = "${pkgs.base16-schemes}/share/themes/gruvbox-${mode}-${cfg.contrast}.yaml";
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.desktop.theming.themes.nord;
|
||||
mode = if cfg.darkMode then "" else "-light";
|
||||
in
|
||||
{
|
||||
options = {
|
||||
desktop.theming.themes.nord = {
|
||||
enable = mkEnableOption "nord";
|
||||
darkMode = mkEnableOption "dark mode";
|
||||
};
|
||||
};
|
||||
|
||||
config.desktop.theming = mkIf cfg.enable {
|
||||
darkMode = cfg.darkMode;
|
||||
colorScheme = "${pkgs.base16-schemes}/share/themes/nord${mode}.yaml";
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.desktop.theming.themes.oxocarbon;
|
||||
mode = if cfg.darkMode then "dark" else "light";
|
||||
in
|
||||
{
|
||||
options = {
|
||||
desktop.theming.themes.oxocarbon = {
|
||||
enable = mkEnableOption "oxocarbon";
|
||||
darkMode = mkEnableOption "dark mode";
|
||||
};
|
||||
};
|
||||
|
||||
config.desktop.theming = mkIf cfg.enable {
|
||||
darkMode = cfg.darkMode;
|
||||
colorScheme = "${pkgs.base16-schemes}/share/themes/oxocarbon-${mode}.yaml";
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.desktop.theming.themes.papercolor;
|
||||
mode = if cfg.darkMode then "dark" else "light";
|
||||
in
|
||||
{
|
||||
options = {
|
||||
desktop.theming.themes.papercolor = {
|
||||
enable = mkEnableOption "papercolor";
|
||||
darkMode = mkEnableOption "dark mode";
|
||||
};
|
||||
};
|
||||
|
||||
config.desktop.theming = mkIf cfg.enable {
|
||||
darkMode = cfg.darkMode;
|
||||
colorScheme = "${pkgs.base16-schemes}/share/themes/papercolor-${mode}.yaml";
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.desktop.theming.themes.sakura;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
desktop.theming.themes.sakura = {
|
||||
enable = mkEnableOption "sakura";
|
||||
};
|
||||
};
|
||||
|
||||
config.desktop.theming = mkIf cfg.enable {
|
||||
darkMode = false;
|
||||
colorScheme = "${pkgs.base16-schemes}/share/themes/sakura.yaml";
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user