nix-config/modules/desktop.nix

153 lines
2.7 KiB
Nix
Raw Normal View History

2024-08-03 20:40:07 +02:00
{
pkgs,
config,
lib,
...
}:
2023-06-11 15:51:26 +02:00
let
inherit (config.modules.system) username;
inherit (config.boot) isContainer;
2024-08-03 20:40:07 +02:00
inherit (lib)
mkEnableOption
mkIf
mkMerge
;
inherit (cfg) bloat;
2024-08-03 20:40:07 +02:00
2024-10-10 20:20:23 +02:00
isPhone = config.programs.calls.enable;
cfg = config.modules.desktop;
in
{
options.modules.desktop = {
bloat = mkEnableOption "GUI applications";
};
config = {
2024-10-10 20:20:23 +02:00
hardware.graphics.enable32Bit = mkIf (!isPhone) true;
programs = {
2024-10-10 20:20:23 +02:00
hyprland.enable = mkIf (!isContainer && !isPhone) true;
cdemu.enable = mkIf (!isPhone) true;
thunar = {
2024-10-10 20:20:23 +02:00
enable = mkIf (!isPhone) true;
2024-09-05 18:11:43 +02:00
plugins = with pkgs.xfce; [
thunar-volman
];
};
};
2023-05-17 15:23:38 +02:00
2024-10-10 20:20:23 +02:00
i18n.inputMethod = mkIf (!isPhone) {
enable = true;
type = "fcitx5";
fcitx5 = {
waylandFrontend = true;
2024-09-05 18:11:43 +02:00
addons = with pkgs; [
fcitx5-mozc
];
};
};
services = {
2024-10-10 20:20:23 +02:00
udisks2 = mkIf (!isPhone) {
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 = true;
};
2024-10-10 20:20:23 +02:00
pipewire = mkIf (!isPhone) {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
};
2024-10-10 20:20:23 +02:00
greetd = mkIf (!isContainer && !isPhone) {
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 != "aarch64-linux") (
with pkgs;
[
anki-bin
]
))
(with pkgs; [
pulseaudio
grim
wl-clipboard-rs
])
];
};
}