2024-08-03 20:40:07 +02:00
|
|
|
{
|
|
|
|
nix-config,
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2023-06-11 15:51:26 +02:00
|
|
|
|
2024-04-04 11:34:30 +02:00
|
|
|
let
|
2024-06-21 03:47:41 +02:00
|
|
|
inherit (lib.types) float int;
|
2024-06-15 16:46:45 +02:00
|
|
|
inherit (config.modules.system) username;
|
2024-09-01 20:31:45 +02:00
|
|
|
inherit (config.boot) isContainer;
|
2024-04-05 19:28:23 +02:00
|
|
|
inherit (nix-config.packages.${pkgs.system}) aleo-fonts;
|
2024-04-09 15:19:29 +02:00
|
|
|
inherit (builtins) attrValues;
|
2024-08-30 02:12:23 +02:00
|
|
|
inherit (config.lib.stylix.colors.withHashtag) base00 base03 base05;
|
2024-04-04 17:00:17 +02:00
|
|
|
|
2024-08-03 20:40:07 +02:00
|
|
|
inherit (lib)
|
|
|
|
mkEnableOption
|
|
|
|
mkIf
|
|
|
|
mkMerge
|
|
|
|
mkOption
|
|
|
|
;
|
|
|
|
|
|
|
|
inherit (cfg)
|
|
|
|
bloat
|
|
|
|
opacity
|
|
|
|
fontSize
|
|
|
|
graphical
|
|
|
|
;
|
|
|
|
|
|
|
|
inherit (pkgs)
|
|
|
|
phinger-cursors
|
|
|
|
noto-fonts-cjk-sans
|
|
|
|
maple-mono
|
|
|
|
noto-fonts-emoji
|
|
|
|
;
|
|
|
|
|
2024-08-30 19:37:28 +02:00
|
|
|
stylix-background = nix-config.packages.${pkgs.system}.stylix-background.override {
|
2024-08-29 07:19:22 +02:00
|
|
|
color = config.lib.stylix.colors.base00;
|
2024-07-18 17:02:07 +02:00
|
|
|
};
|
|
|
|
|
2024-04-04 11:34:30 +02:00
|
|
|
cfg = config.modules.desktop;
|
|
|
|
in
|
|
|
|
{
|
2024-04-05 15:36:21 +02:00
|
|
|
imports = attrValues {
|
2024-04-05 16:09:51 +02:00
|
|
|
inherit (nix-config.inputs.stylix.nixosModules) stylix;
|
2024-04-05 15:36:21 +02:00
|
|
|
};
|
|
|
|
|
2024-04-04 11:34:30 +02:00
|
|
|
options.modules.desktop = {
|
2024-04-07 18:30:50 +02:00
|
|
|
opacity = mkOption {
|
|
|
|
type = float;
|
|
|
|
default = 0.95;
|
|
|
|
};
|
|
|
|
|
|
|
|
fontSize = mkOption {
|
|
|
|
type = int;
|
|
|
|
default = 11;
|
|
|
|
};
|
|
|
|
|
2024-05-28 21:22:25 +02:00
|
|
|
bloat = mkEnableOption "GUI applications";
|
2024-05-19 17:18:36 +02:00
|
|
|
graphical = mkEnableOption "xserver for graphical containers";
|
2024-01-13 06:38:42 +01:00
|
|
|
};
|
2023-06-17 15:42:47 +02:00
|
|
|
|
2024-04-05 02:05:08 +02:00
|
|
|
config = {
|
2024-07-15 17:37:30 +02:00
|
|
|
hardware.graphics.enable32Bit = true;
|
2024-04-04 18:19:41 +02:00
|
|
|
|
2024-04-04 16:13:02 +02:00
|
|
|
programs = {
|
2024-09-01 20:31:45 +02:00
|
|
|
hyprland.enable = mkIf (!isContainer) true;
|
2024-07-15 17:37:30 +02:00
|
|
|
cdemu.enable = true;
|
2024-04-04 16:13:02 +02:00
|
|
|
|
2024-07-15 17:37:30 +02:00
|
|
|
thunar = {
|
2024-04-04 16:13:02 +02:00
|
|
|
enable = true;
|
2024-04-05 19:28:23 +02:00
|
|
|
|
2024-08-03 20:40:07 +02:00
|
|
|
plugins = with pkgs.xfce; [ thunar-volman ];
|
2024-04-04 16:13:02 +02:00
|
|
|
};
|
|
|
|
};
|
2023-05-17 15:23:38 +02:00
|
|
|
|
2024-07-14 22:54:23 +02:00
|
|
|
i18n.inputMethod = {
|
2024-07-16 18:25:04 +02:00
|
|
|
enable = true;
|
|
|
|
type = "fcitx5";
|
2024-04-04 03:39:13 +02:00
|
|
|
|
2024-04-04 11:34:30 +02:00
|
|
|
fcitx5 = {
|
|
|
|
addons = with pkgs; [ fcitx5-mozc ];
|
|
|
|
waylandFrontend = true;
|
|
|
|
};
|
|
|
|
};
|
2024-04-04 03:39:13 +02:00
|
|
|
|
2024-04-04 14:11:11 +02:00
|
|
|
services = {
|
2024-07-15 17:37:30 +02:00
|
|
|
udisks2 = {
|
2024-04-04 14:11:11 +02:00
|
|
|
enable = true;
|
|
|
|
mountOnMedia = true;
|
|
|
|
};
|
2024-04-04 05:02:44 +02:00
|
|
|
|
2024-08-29 07:39:40 +02:00
|
|
|
libinput = {
|
|
|
|
touchpad = {
|
|
|
|
naturalScrolling = true;
|
|
|
|
accelProfile = "flat";
|
|
|
|
accelSpeed = "0.75";
|
|
|
|
};
|
|
|
|
|
|
|
|
mouse = {
|
|
|
|
accelProfile = "flat";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-09-01 20:31:45 +02:00
|
|
|
xserver = mkIf (!isContainer || graphical) {
|
2024-04-04 11:34:30 +02:00
|
|
|
enable = true;
|
2024-08-03 20:40:07 +02:00
|
|
|
excludePackages = with pkgs; [ xterm ];
|
2024-08-29 07:39:40 +02:00
|
|
|
|
2024-09-01 20:31:45 +02:00
|
|
|
displayManager.startx.enable = mkIf (!isContainer) true;
|
2024-08-29 07:39:40 +02:00
|
|
|
|
2024-09-01 20:31:45 +02:00
|
|
|
windowManager.dwm = mkIf (!isContainer) {
|
2024-08-29 07:39:40 +02:00
|
|
|
enable = true;
|
|
|
|
|
2024-08-30 02:12:23 +02:00
|
|
|
package = pkgs.dwm.override {
|
|
|
|
conf = # c
|
|
|
|
''
|
|
|
|
#include <X11/XF86keysym.h>
|
|
|
|
|
|
|
|
static const unsigned int borderpx = 0;
|
|
|
|
static const unsigned int snap = 32;
|
|
|
|
static const int user_bh = 10;
|
|
|
|
static const int showbar = 1;
|
|
|
|
static const int topbar = 1;
|
|
|
|
static const char *fonts[] = {
|
|
|
|
"Maple Mono:size=10",
|
|
|
|
"Noto Sans Mono CJK JP:size=10",
|
|
|
|
"Noto Color Emoji:size=10",
|
|
|
|
};
|
|
|
|
|
|
|
|
static const char *colors[][3] = {
|
|
|
|
[SchemeNorm] = { "${base03}", "${base00}", "${base03}" },
|
|
|
|
[SchemeSel] = { "${base05}", "${base00}", "${base05}" },
|
|
|
|
};
|
|
|
|
|
|
|
|
static const unsigned int baralpha = 243;
|
|
|
|
|
|
|
|
static const unsigned int alphas[][3] = {
|
|
|
|
[SchemeNorm] = { OPAQUE, baralpha, baralpha },
|
|
|
|
[SchemeSel] = { OPAQUE, baralpha, baralpha },
|
|
|
|
};
|
|
|
|
|
|
|
|
static const char *tags[] = { "⬤", "⬤", "⬤" };
|
|
|
|
|
|
|
|
static const Rule rules[] = {
|
|
|
|
{ "librewolf", NULL, NULL, 0, 1, -1 },
|
|
|
|
};
|
|
|
|
|
|
|
|
static const float mfact = 0.55;
|
|
|
|
static const int nmaster = 1;
|
|
|
|
static const int resizehints = 1;
|
|
|
|
static const int lockfullscreen = 1;
|
|
|
|
|
|
|
|
static const Layout layouts[] = {
|
|
|
|
{ "[]=", tile },
|
|
|
|
};
|
|
|
|
|
|
|
|
#define MODKEY Mod4Mask
|
|
|
|
|
|
|
|
static char dmenumon[2] = "0";
|
|
|
|
static const char *dmenucmd[] = { "rofi", "-show", "drun", NULL };
|
|
|
|
static const char *quitcmd[] = { "kill", "xinit", NULL };
|
|
|
|
static const char *termcmd[] = { "kitty", NULL };
|
|
|
|
static const char *brighter[] = { "brightnessctl", "set", "5%+", NULL };
|
|
|
|
static const char *dimmer[] = { "brightnessctl", "set", "5%-", NULL };
|
|
|
|
static const char *up_vol[] = { "wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", "5%+", NULL };
|
|
|
|
static const char *down_vol[] = { "wpctl", "set-volume", "@DEFAULT_AUDIO_SINK@", "5%-", NULL };
|
|
|
|
static const char *mute_vol[] = { "wpctl", "set-mute", "@DEFAULT_AUDIO_SINK@", "toggle", NULL };
|
|
|
|
|
|
|
|
static const Key keys[] = {
|
|
|
|
{ 0, XF86XK_AudioMute, spawn, {.v = mute_vol } },
|
|
|
|
{ 0, XF86XK_AudioLowerVolume, spawn, {.v = down_vol } },
|
|
|
|
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = up_vol } },
|
|
|
|
{ 0, XF86XK_MonBrightnessDown, spawn, {.v = dimmer } },
|
|
|
|
{ 0, XF86XK_MonBrightnessUp, spawn, {.v = brighter } },
|
|
|
|
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
|
|
|
{ MODKEY, XK_o, togglebar, {0} },
|
|
|
|
{ MODKEY, XK_f, togglefullscr, {0} },
|
|
|
|
{ MODKEY, XK_v, togglefloating, {0} },
|
|
|
|
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
|
|
|
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
|
|
|
{ MODKEY, XK_Return, zoom, {0} },
|
|
|
|
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
|
|
|
{ MODKEY, XK_period, focusmon, {.i = +1 } },
|
|
|
|
{ MODKEY, XK_1, viewprev, {0} },
|
|
|
|
{ MODKEY, XK_2, viewnext, {0} },
|
|
|
|
{ MODKEY|ShiftMask, XK_1, tagtoprev, {0} },
|
|
|
|
{ MODKEY|ShiftMask, XK_1, reorganizetags, {0} },
|
|
|
|
{ MODKEY|ShiftMask, XK_2, tagtonext, {0} },
|
|
|
|
{ MODKEY|ShiftMask, XK_2, reorganizetags, {0} },
|
|
|
|
{ MODKEY|ShiftMask, XK_h, setmfact, {.f = -0.05} },
|
|
|
|
{ MODKEY|ShiftMask, XK_l, setmfact, {.f = +0.05} },
|
|
|
|
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
|
|
|
{ MODKEY|ShiftMask, XK_q, killclient, {0} },
|
|
|
|
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
|
|
|
|
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
|
|
|
|
{ MODKEY|Mod1Mask, XK_Delete, spawn, {.v = quitcmd } },
|
|
|
|
};
|
|
|
|
|
|
|
|
static const Button buttons[] = {
|
|
|
|
{ ClkTagBar, 0, Button1, view, {0} },
|
|
|
|
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
|
|
|
|
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
|
|
|
|
};
|
|
|
|
'';
|
|
|
|
|
|
|
|
patches = with pkgs; [
|
|
|
|
../assets/dwm-actualfullscreen.patch
|
|
|
|
../assets/dwm-adjacenttag.patch
|
|
|
|
../assets/dwm-remove-layout-indicator.patch
|
|
|
|
../assets/dwm-remove-floating-indicator.patch
|
|
|
|
../assets/dwm-savefloats-alwayscenter.patch
|
|
|
|
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://dwm.suckless.org/patches/hide_vacant_tags/dwm-hide_vacant_tags-6.4.diff";
|
|
|
|
hash = "sha256-GIbRW0Inwbp99rsKLfIDGvPwZ3pqihROMBp5vFlHx5Q=";
|
|
|
|
})
|
|
|
|
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://dwm.suckless.org/patches/alpha/dwm-alpha-20230401-348f655.diff";
|
|
|
|
hash = "sha256-ZhuqyDpY+nQQgrjniQ9DNheUgE9o/MUXKaJYRU3Uyl4=";
|
|
|
|
})
|
|
|
|
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://dwm.suckless.org/patches/reorganizetags/dwm-reorganizetags-6.2.diff";
|
|
|
|
hash = "sha256-Fj+cfw+5d7i6UrakMbebhZsfmu8ZfooduQA08STovK4=";
|
|
|
|
})
|
|
|
|
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://dwm.suckless.org/patches/bar_height/dwm-bar-height-spacing-6.3.diff";
|
|
|
|
hash = "sha256-usMIMmloUG4NrX10AVbgr8kFs9ZG6Krn1NxXTVcLq70=";
|
|
|
|
})
|
|
|
|
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://raw.githubusercontent.com/bakkeby/patches/c5eae9d/dwm/dwm-desktop_icons-6.5.diff";
|
|
|
|
hash = "sha256-oIgeph9pmIWKBepnQhc+aNWU7ZHxsJbhJr5LVNTtuHc=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
2024-08-29 07:39:40 +02:00
|
|
|
};
|
2024-04-04 05:02:44 +02:00
|
|
|
};
|
|
|
|
|
2024-07-15 17:37:30 +02:00
|
|
|
pipewire = {
|
2024-04-04 14:11:11 +02:00
|
|
|
enable = true;
|
|
|
|
|
|
|
|
alsa = {
|
|
|
|
enable = true;
|
2024-07-15 17:37:30 +02:00
|
|
|
support32Bit = true;
|
2024-04-04 14:11:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
pulse.enable = true;
|
|
|
|
};
|
2024-04-04 16:13:02 +02:00
|
|
|
|
2024-09-01 20:31:45 +02:00
|
|
|
greetd = mkIf (!isContainer) {
|
2024-04-11 11:34:49 +02:00
|
|
|
enable = true;
|
|
|
|
restart = false;
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
default_session = {
|
|
|
|
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd Hyprland --time-format '%F %R'";
|
|
|
|
user = "greeter";
|
|
|
|
};
|
|
|
|
|
|
|
|
initial_session = {
|
2024-07-15 17:37:30 +02:00
|
|
|
command = "${pkgs.hyprland}/bin/Hyprland";
|
2024-04-11 11:34:49 +02:00
|
|
|
user = username;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-04-04 16:13:02 +02:00
|
|
|
tumbler.enable = true;
|
|
|
|
gvfs.enable = true;
|
|
|
|
gnome.gnome-keyring.enable = true;
|
2024-05-13 17:04:41 +02:00
|
|
|
upower.enable = true;
|
2024-04-04 05:02:44 +02:00
|
|
|
};
|
2024-04-04 05:09:28 +02:00
|
|
|
|
2024-04-05 02:02:51 +02:00
|
|
|
environment.systemPackages = mkMerge [
|
2024-08-27 03:32:55 +02:00
|
|
|
(mkIf bloat (
|
|
|
|
with pkgs;
|
|
|
|
[
|
|
|
|
mullvad-browser
|
|
|
|
spek
|
|
|
|
audacity
|
|
|
|
gimp
|
|
|
|
libreoffice
|
|
|
|
element-desktop
|
|
|
|
signal-desktop
|
|
|
|
qbittorrent
|
|
|
|
popsicle
|
|
|
|
satty
|
|
|
|
srb2
|
|
|
|
ringracers
|
|
|
|
jamesdsp
|
|
|
|
texliveFull
|
|
|
|
]
|
|
|
|
))
|
2024-08-25 23:03:37 +02:00
|
|
|
|
2024-08-27 19:57:12 +02:00
|
|
|
(mkIf (pkgs.system == "x86_64-linux") (
|
|
|
|
with nix-config.inputs.sakaya.packages.${pkgs.system}; [ sakaya ]
|
|
|
|
))
|
2024-08-25 23:03:37 +02:00
|
|
|
|
|
|
|
(with pkgs; [
|
|
|
|
anki
|
|
|
|
pulseaudio
|
|
|
|
grim
|
|
|
|
wl-clipboard-rs
|
|
|
|
])
|
2024-04-04 05:09:28 +02:00
|
|
|
];
|
|
|
|
|
2024-04-04 11:34:30 +02:00
|
|
|
fonts = {
|
|
|
|
enableDefaultPackages = false;
|
|
|
|
|
2024-08-03 20:40:07 +02:00
|
|
|
packages =
|
|
|
|
[
|
|
|
|
noto-fonts-cjk-sans
|
|
|
|
noto-fonts-emoji
|
|
|
|
maple-mono
|
|
|
|
aleo-fonts
|
|
|
|
]
|
|
|
|
++ (with pkgs; [
|
|
|
|
noto-fonts
|
|
|
|
noto-fonts-cjk-serif
|
|
|
|
font-awesome
|
|
|
|
(nerdfonts.override { fonts = [ "Noto" ]; })
|
|
|
|
kanji-stroke-order-font
|
|
|
|
liberation_ttf
|
|
|
|
]);
|
2024-04-04 11:34:30 +02:00
|
|
|
|
|
|
|
fontconfig = {
|
|
|
|
defaultFonts = {
|
2024-08-03 20:40:07 +02:00
|
|
|
serif = [
|
|
|
|
"Noto Serif CJK JP"
|
|
|
|
"Noto Serif"
|
|
|
|
];
|
|
|
|
|
|
|
|
sansSerif = [
|
|
|
|
"Noto Sans CJK JP"
|
|
|
|
"Noto Sans"
|
|
|
|
];
|
|
|
|
|
|
|
|
monospace = [
|
|
|
|
"Noto Sans Mono CJK JP"
|
|
|
|
"Noto Sans Mono"
|
|
|
|
];
|
2024-04-04 11:34:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
allowBitmaps = false;
|
|
|
|
};
|
2024-04-04 05:09:28 +02:00
|
|
|
};
|
2024-04-06 01:01:41 +02:00
|
|
|
|
2024-04-04 17:00:17 +02:00
|
|
|
stylix = {
|
2024-07-05 20:09:52 +02:00
|
|
|
enable = true;
|
2024-07-18 17:02:07 +02:00
|
|
|
image = "${stylix-background}/wallpaper.png";
|
2024-04-04 17:00:17 +02:00
|
|
|
polarity = "dark";
|
2024-08-24 04:42:55 +02:00
|
|
|
base16Scheme = {
|
|
|
|
system = "base16";
|
|
|
|
name = "selenized-black";
|
|
|
|
author = "Jan Warchol (https://github.com/jan-warchol/selenized) / adapted to base16 by ali";
|
|
|
|
variant = "dark";
|
|
|
|
|
|
|
|
palette = {
|
|
|
|
base00 = "181818";
|
|
|
|
base01 = "252525";
|
|
|
|
base02 = "3b3b3b";
|
|
|
|
base03 = "777777";
|
|
|
|
base04 = "777777";
|
|
|
|
base05 = "b9b9b9";
|
|
|
|
base06 = "dedede";
|
|
|
|
base07 = "dedede";
|
|
|
|
base08 = "ed4a46";
|
|
|
|
base09 = "e67f43";
|
|
|
|
base0A = "dbb32d";
|
|
|
|
base0B = "70b433";
|
|
|
|
base0C = "3fc5b7";
|
|
|
|
base0D = "368aeb";
|
|
|
|
base0E = "a580e2";
|
|
|
|
base0F = "eb6eb7";
|
|
|
|
};
|
|
|
|
};
|
2024-04-04 17:00:17 +02:00
|
|
|
|
|
|
|
opacity = {
|
|
|
|
terminal = opacity;
|
|
|
|
popups = opacity;
|
|
|
|
};
|
|
|
|
|
2024-04-07 18:30:50 +02:00
|
|
|
cursor = {
|
2024-04-04 17:00:17 +02:00
|
|
|
package = phinger-cursors;
|
2024-04-19 03:28:10 +02:00
|
|
|
name = "phinger-cursors";
|
2024-04-04 17:00:17 +02:00
|
|
|
size = 24;
|
|
|
|
};
|
|
|
|
|
2024-04-07 18:30:50 +02:00
|
|
|
fonts = {
|
2024-04-04 17:00:17 +02:00
|
|
|
serif = {
|
2024-04-05 19:28:23 +02:00
|
|
|
package = aleo-fonts;
|
2024-04-04 17:00:17 +02:00
|
|
|
name = "Aleo";
|
|
|
|
};
|
|
|
|
|
2024-07-15 17:38:42 +02:00
|
|
|
sansSerif = {
|
|
|
|
package = noto-fonts-cjk-sans;
|
|
|
|
name = "Noto Sans CJK JP";
|
|
|
|
};
|
2024-04-04 17:00:17 +02:00
|
|
|
|
|
|
|
monospace = {
|
|
|
|
package = maple-mono;
|
|
|
|
name = "Maple Mono";
|
|
|
|
};
|
|
|
|
|
|
|
|
emoji = {
|
|
|
|
package = noto-fonts-emoji;
|
|
|
|
name = "Noto Color Emoji";
|
|
|
|
};
|
|
|
|
|
|
|
|
sizes = {
|
2024-04-07 18:30:50 +02:00
|
|
|
applications = fontSize;
|
|
|
|
desktop = fontSize;
|
|
|
|
popups = fontSize;
|
|
|
|
terminal = fontSize;
|
2024-04-04 17:00:17 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-04-04 05:09:28 +02:00
|
|
|
};
|
2023-05-17 01:10:15 +02:00
|
|
|
}
|