2024-04-06 18:27:08 +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-04-07 18:30:50 +02:00
|
|
|
inherit (lib) mkEnableOption mkIf mkMerge mkOption;
|
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-06-21 03:47:41 +02:00
|
|
|
inherit (cfg) bloat gnome plasma container opacity fontSize graphical phone phosh;
|
2024-04-05 19:28:23 +02:00
|
|
|
inherit (nix-config.packages.${pkgs.system}) aleo-fonts;
|
2024-04-07 18:30:50 +02:00
|
|
|
inherit (pkgs) phinger-cursors noto-fonts-cjk-sans maple-mono noto-fonts-emoji;
|
2024-04-09 15:19:29 +02:00
|
|
|
inherit (builtins) attrValues;
|
2024-04-04 17:00:17 +02:00
|
|
|
|
2024-06-20 01:53:31 +02:00
|
|
|
legacyHyprland = pkgs.hyprland.override {
|
|
|
|
legacyRenderer = true;
|
|
|
|
};
|
|
|
|
|
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.home-manager.nixosModules) home-manager;
|
|
|
|
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-06-19 08:06:41 +02:00
|
|
|
phone = mkEnableOption "Phone support";
|
2024-04-06 14:30:32 +02:00
|
|
|
gnome = mkEnableOption "GNOME specialization";
|
|
|
|
plasma = mkEnableOption "Plasma specialization";
|
2024-04-07 01:35:51 +02:00
|
|
|
container = mkEnableOption "disable some options for container performance";
|
2024-05-19 17:18:36 +02:00
|
|
|
graphical = mkEnableOption "xserver for graphical containers";
|
2024-06-20 19:22:41 +02:00
|
|
|
phosh = mkEnableOption "use phosh instead of hyprland";
|
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-06-19 08:06:41 +02:00
|
|
|
hardware.opengl.driSupport32Bit = mkIf (!phone) true;
|
2024-04-04 18:19:41 +02:00
|
|
|
|
2024-04-04 16:13:02 +02:00
|
|
|
programs = {
|
2024-06-15 16:46:45 +02:00
|
|
|
hyprland.enable = mkIf (!container) true;
|
2024-06-19 08:06:41 +02:00
|
|
|
cdemu.enable = mkIf (!phone) true;
|
2024-04-04 16:13:02 +02:00
|
|
|
|
|
|
|
thunar = {
|
|
|
|
enable = true;
|
2024-04-05 19:28:23 +02:00
|
|
|
|
2024-04-05 13:04:22 +02:00
|
|
|
plugins = attrValues {
|
|
|
|
inherit (pkgs.xfce) thunar-volman;
|
|
|
|
};
|
2024-04-04 16:13:02 +02:00
|
|
|
};
|
|
|
|
};
|
2023-05-17 15:23:38 +02:00
|
|
|
|
2024-06-20 19:22:41 +02:00
|
|
|
i18n.inputMethod = mkIf (!phosh) {
|
2024-04-04 11:34:30 +02:00
|
|
|
enabled = "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-06-20 19:19:32 +02:00
|
|
|
udisks2 = mkIf (!phone) {
|
2024-04-04 14:11:11 +02:00
|
|
|
enable = true;
|
|
|
|
mountOnMedia = true;
|
|
|
|
};
|
2024-04-04 05:02:44 +02:00
|
|
|
|
2024-05-19 17:18:36 +02:00
|
|
|
xserver = mkIf (!container || graphical) {
|
2024-04-04 11:34:30 +02:00
|
|
|
enable = true;
|
2024-04-04 14:11:11 +02:00
|
|
|
excludePackages = [ pkgs.xterm ];
|
2024-06-20 19:22:41 +02:00
|
|
|
|
|
|
|
displayManager.lightdm.enable = mkIf phosh false;
|
|
|
|
|
|
|
|
desktopManager.phosh = mkIf phosh {
|
|
|
|
enable = true;
|
|
|
|
group = "users";
|
|
|
|
user = username;
|
2024-06-22 00:47:10 +02:00
|
|
|
|
|
|
|
phocConfig = {
|
|
|
|
xwayland = "immediate";
|
|
|
|
};
|
2024-06-20 19:22:41 +02:00
|
|
|
};
|
2024-04-04 05:02:44 +02:00
|
|
|
};
|
|
|
|
|
2024-06-20 19:22:41 +02:00
|
|
|
pipewire = mkIf (!phosh) {
|
2024-04-04 14:11:11 +02:00
|
|
|
enable = true;
|
|
|
|
|
|
|
|
alsa = {
|
|
|
|
enable = true;
|
2024-06-20 19:22:41 +02:00
|
|
|
support32Bit = mkIf (!phone) true;
|
2024-04-04 14:11:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
pulse.enable = true;
|
|
|
|
};
|
2024-04-04 16:13:02 +02:00
|
|
|
|
2024-06-20 19:22:41 +02:00
|
|
|
greetd = mkIf (!container && !phosh) {
|
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-06-20 01:53:31 +02:00
|
|
|
command = "${if phone then legacyHyprland else 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 [
|
|
|
|
(mkIf bloat (attrValues {
|
|
|
|
inherit (pkgs)
|
|
|
|
mullvad-browser
|
|
|
|
spek
|
|
|
|
audacity
|
|
|
|
gimp
|
|
|
|
sqlitebrowser
|
|
|
|
qdirstat
|
|
|
|
libreoffice
|
|
|
|
krita
|
|
|
|
element-desktop
|
|
|
|
signal-desktop
|
|
|
|
qbittorrent
|
|
|
|
obs-studio
|
2024-06-13 19:20:24 +02:00
|
|
|
popsicle
|
2024-04-06 16:19:02 +02:00
|
|
|
satty
|
|
|
|
aaaaxy
|
|
|
|
srb2
|
2024-06-16 12:20:51 +02:00
|
|
|
ringracers
|
2024-04-06 17:35:34 +02:00
|
|
|
jamesdsp
|
2024-04-05 17:26:22 +02:00
|
|
|
;
|
2024-04-05 02:02:51 +02:00
|
|
|
}))
|
|
|
|
|
2024-06-20 18:19:19 +02:00
|
|
|
(mkIf (!phone) (attrValues {
|
|
|
|
inherit (nix-config.inputs.sakaya.packages.${pkgs.system}) sakaya;
|
2024-06-20 19:50:15 +02:00
|
|
|
inherit (pkgs) texliveFull;
|
2024-06-20 18:19:19 +02:00
|
|
|
}))
|
|
|
|
|
2024-06-20 19:41:34 +02:00
|
|
|
(mkIf phone (attrValues {
|
2024-06-21 11:19:19 +02:00
|
|
|
inherit (pkgs.gnome)
|
|
|
|
eog
|
|
|
|
geary
|
|
|
|
gnome-calendar
|
|
|
|
gnome-contacts
|
|
|
|
gnome-clocks
|
|
|
|
gnome-chess
|
|
|
|
gnome-sound-recorder
|
|
|
|
gnome-maps
|
|
|
|
;
|
2024-06-20 19:41:34 +02:00
|
|
|
inherit (pkgs)
|
|
|
|
gurk-rs
|
|
|
|
android-tools
|
|
|
|
chatty
|
|
|
|
gnome-console
|
|
|
|
megapixels
|
|
|
|
wvkbd
|
2024-06-21 11:19:19 +02:00
|
|
|
blanket
|
|
|
|
gnome-2048
|
|
|
|
dialect
|
|
|
|
deja-dup
|
|
|
|
folio
|
|
|
|
fractal
|
|
|
|
freetube
|
|
|
|
furtherance
|
|
|
|
g4music
|
|
|
|
livi
|
|
|
|
newsflash
|
|
|
|
papers
|
|
|
|
phosh-mobile-settings
|
|
|
|
resources
|
|
|
|
smile
|
|
|
|
tuba
|
|
|
|
wike
|
|
|
|
caerbannog
|
2024-06-20 19:41:34 +02:00
|
|
|
;
|
|
|
|
}))
|
|
|
|
|
2024-04-05 13:04:22 +02:00
|
|
|
(attrValues {
|
2024-04-06 19:40:41 +02:00
|
|
|
inherit (pkgs) anki kanjidraw pulseaudio glib;
|
2024-04-05 13:04:22 +02:00
|
|
|
inherit (pkgs.xfce) exo;
|
|
|
|
})
|
2024-04-04 05:09:28 +02:00
|
|
|
];
|
|
|
|
|
2024-04-04 11:34:30 +02:00
|
|
|
fonts = {
|
|
|
|
enableDefaultPackages = false;
|
|
|
|
|
|
|
|
packages = with pkgs; [
|
|
|
|
noto-fonts
|
|
|
|
noto-fonts-cjk-sans
|
|
|
|
noto-fonts-cjk-serif
|
|
|
|
noto-fonts-emoji
|
|
|
|
maple-mono
|
|
|
|
font-awesome
|
2024-05-26 11:24:03 +02:00
|
|
|
(nerdfonts.override { fonts = [ "Noto" ]; })
|
2024-04-04 11:34:30 +02:00
|
|
|
kanji-stroke-order-font
|
|
|
|
liberation_ttf
|
2024-04-07 16:13:07 +02:00
|
|
|
aleo-fonts
|
2024-04-04 11:34:30 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
fontconfig = {
|
|
|
|
defaultFonts = {
|
|
|
|
serif = [ "Noto Serif CJK JP" "Noto Serif" ];
|
|
|
|
sansSerif = [ "Noto Sans CJK JP" "Noto Sans" ];
|
|
|
|
monospace = [ "Noto Sans Mono CJK JP" "Noto Sans Mono" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
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 = {
|
|
|
|
image = ../assets/wallpaper.png;
|
|
|
|
polarity = "dark";
|
2024-06-21 03:47:41 +02:00
|
|
|
base16Scheme = ../assets/selenized-black.yaml;
|
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";
|
|
|
|
};
|
|
|
|
|
|
|
|
sansSerif = {
|
|
|
|
package = noto-fonts-cjk-sans;
|
|
|
|
name = "Noto Sans CJK JP";
|
|
|
|
};
|
|
|
|
|
|
|
|
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-06 14:30:32 +02:00
|
|
|
|
|
|
|
specialisation = {
|
2024-04-06 15:44:16 +02:00
|
|
|
gnome = mkIf gnome {
|
|
|
|
configuration.imports = [ ../specializations/gnome.nix ];
|
|
|
|
};
|
|
|
|
|
|
|
|
plasma = mkIf plasma {
|
|
|
|
configuration.imports = [ ../specializations/plasma.nix ];
|
|
|
|
};
|
2024-04-06 14:30:32 +02:00
|
|
|
};
|
2024-04-04 05:09:28 +02:00
|
|
|
};
|
2023-05-17 01:10:15 +02:00
|
|
|
}
|