nix-config/modules/desktop.nix

289 lines
5.6 KiB
Nix
Raw Normal View History

2024-08-03 20:40:07 +02:00
{
nix-config,
pkgs,
config,
lib,
...
}:
2023-06-11 15:51:26 +02:00
let
inherit (lib.types) float int;
inherit (config.modules.system) username;
inherit (config.boot) isContainer;
inherit (nix-config.packages.${pkgs.system}) aleo-fonts;
2024-04-09 15:19:29 +02:00
inherit (builtins) attrValues;
2024-08-03 20:40:07 +02:00
inherit (lib)
mkEnableOption
mkIf
mkMerge
mkOption
;
inherit (cfg)
bloat
opacity
fontSize
;
stylix-background = nix-config.packages.${pkgs.system}.stylix-background.override {
color = config.lib.stylix.colors.base00;
};
cfg = config.modules.desktop;
in
{
imports = attrValues {
inherit (nix-config.inputs.stylix.nixosModules) stylix;
};
options.modules.desktop = {
opacity = mkOption {
type = float;
default = 0.95;
};
fontSize = mkOption {
type = int;
default = 11;
};
bloat = mkEnableOption "GUI applications";
};
config = {
hardware.graphics.enable32Bit = true;
programs = {
hyprland.enable = mkIf (!isContainer) true;
cdemu.enable = true;
thunar = {
enable = true;
2024-09-05 18:11:43 +02:00
plugins = with pkgs.xfce; [
thunar-volman
];
};
};
2023-05-17 15:23:38 +02:00
i18n.inputMethod = {
enable = true;
type = "fcitx5";
fcitx5 = {
waylandFrontend = true;
2024-09-05 18:11:43 +02:00
addons = with pkgs; [
fcitx5-mozc
];
};
};
services = {
udisks2 = {
enable = true;
mountOnMedia = true;
};
libinput = {
touchpad = {
naturalScrolling = true;
accelProfile = "flat";
accelSpeed = "0.75";
};
mouse = {
accelProfile = "flat";
};
};
xserver = mkIf (!isContainer) {
enable = true;
2024-08-03 20:40:07 +02:00
excludePackages = with pkgs; [ xterm ];
displayManager.startx.enable = mkIf (!isContainer) true;
};
pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
};
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 = {
command = "${pkgs.hyprland}/bin/Hyprland";
2024-04-11 11:34:49 +02:00
user = username;
};
};
};
tumbler.enable = true;
gvfs.enable = true;
gnome.gnome-keyring.enable = true;
upower.enable = true;
};
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
]
))
(mkIf (pkgs.system == "x86_64-linux") (
with nix-config.inputs.sakaya.packages.${pkgs.system}; [ sakaya ]
))
(with pkgs; [
anki
pulseaudio
grim
wl-clipboard-rs
])
];
fonts = {
enableDefaultPackages = false;
2024-08-03 20:40:07 +02:00
packages =
[
aleo-fonts
]
++ (with pkgs; [
noto-fonts
noto-fonts-cjk-serif
noto-fonts-cjk-sans
noto-fonts-emoji
maple-mono
2024-08-03 20:40:07 +02:00
font-awesome
(nerdfonts.override { fonts = [ "Noto" ]; })
kanji-stroke-order-font
liberation_ttf
]);
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"
];
};
allowBitmaps = false;
};
};
2024-04-06 01:01:41 +02:00
stylix = {
enable = true;
image = "${stylix-background}/wallpaper.png";
polarity = "dark";
2024-09-05 18:11:43 +02:00
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";
};
};
opacity = {
terminal = opacity;
popups = opacity;
};
cursor = {
package = pkgs.phinger-cursors;
name = "phinger-cursors";
size = 24;
};
fonts = {
serif = {
package = aleo-fonts;
name = "Aleo";
};
sansSerif = {
package = pkgs.noto-fonts-cjk-sans;
name = "Noto Sans CJK JP";
};
monospace = {
package = pkgs.maple-mono;
name = "Maple Mono";
};
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
sizes = {
applications = fontSize;
desktop = fontSize;
popups = fontSize;
terminal = fontSize;
};
};
};
};
}