2024-06-24 15:38:28 +00:00
|
|
|
# Common desktop environment modules
|
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
2024-12-06 18:04:47 +00:00
|
|
|
namespace,
|
2024-06-24 15:38:28 +00:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2024-12-06 18:04:47 +00:00
|
|
|
cfg = config.${namespace}.ui.desktops;
|
2024-06-24 15:38:28 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
2024-12-06 18:04:47 +00:00
|
|
|
${namespace}.ui.desktops = {
|
2024-09-08 15:58:56 +00:00
|
|
|
enable = lib.mkEnableOption "Enables base desktop environment support.";
|
2024-06-24 15:38:28 +00:00
|
|
|
xkb = lib.mkOption {
|
|
|
|
description = "The keyboard layout to use by default. Defaults to us.";
|
|
|
|
type = lib.types.attrs;
|
|
|
|
default = {
|
|
|
|
layout = "us";
|
|
|
|
variant = "";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2024-12-06 18:04:47 +00:00
|
|
|
${namespace} = {
|
2024-10-18 20:14:33 +00:00
|
|
|
bluetooth = {
|
|
|
|
enable = true;
|
|
|
|
experimental.enable = true;
|
|
|
|
};
|
2024-10-04 14:05:02 +00:00
|
|
|
packages = with pkgs; [
|
|
|
|
qjournalctl # Journalctl frontend
|
|
|
|
];
|
2024-06-24 15:38:28 +00:00
|
|
|
ui.audio.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
# Enable Plymouth for graphical bootsplash.
|
|
|
|
plymouth = {
|
|
|
|
enable = true;
|
|
|
|
theme = "bgrt";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Add kernel parameters
|
|
|
|
kernelParams = [
|
|
|
|
"quiet"
|
|
|
|
"splash"
|
|
|
|
];
|
2024-06-24 19:37:10 +00:00
|
|
|
|
|
|
|
# Increase minimum log level. This removes ACPI errors from the boot screen.
|
|
|
|
consoleLogLevel = 1;
|
2024-06-24 15:38:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Manage fonts
|
|
|
|
fonts = {
|
|
|
|
# Install extra fonts
|
|
|
|
packages = with pkgs; [
|
|
|
|
noto-fonts
|
2024-11-18 16:10:20 +00:00
|
|
|
noto-fonts-cjk-sans
|
2024-06-24 15:38:28 +00:00
|
|
|
noto-fonts-emoji
|
|
|
|
liberation_ttf
|
|
|
|
fira-code
|
2024-10-15 14:22:53 +00:00
|
|
|
fira-code-nerdfont
|
2024-06-24 15:38:28 +00:00
|
|
|
fira-code-symbols
|
|
|
|
fira
|
|
|
|
roboto-slab
|
|
|
|
];
|
|
|
|
|
2024-07-13 17:34:59 +00:00
|
|
|
# Enable font dir for use with Flatpak. See https://wiki.nixos.org/wiki/Fonts#Flatpak_applications_can.27t_find_system_fonts
|
2024-06-24 15:38:28 +00:00
|
|
|
fontDir.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
services = {
|
|
|
|
# Configure the xserver
|
|
|
|
xserver = {
|
|
|
|
# Enable the X11 windowing system.
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
# Configure keymap in X11
|
2024-12-06 18:04:47 +00:00
|
|
|
xkb = config.${namespace}.ui.desktops.xkb;
|
2024-06-24 15:38:28 +00:00
|
|
|
};
|
2024-06-24 16:24:21 +00:00
|
|
|
|
|
|
|
# Enable touchpad support (enabled by default in most desktop managers, buuuut just in case).
|
|
|
|
libinput.enable = true;
|
2024-06-25 18:13:15 +00:00
|
|
|
|
2024-10-03 14:26:56 +00:00
|
|
|
# Enable printing support, but disable browsed per https://discourse.nixos.org/t/cups-cups-filters-and-libppd-security-issues/52780.
|
2024-09-28 05:07:47 +00:00
|
|
|
printing = {
|
|
|
|
enable = true;
|
2024-10-03 14:26:56 +00:00
|
|
|
browsed.enable = false;
|
2024-09-28 05:07:47 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-06-24 15:38:28 +00:00
|
|
|
# Support for AppImage files
|
|
|
|
programs.appimage = {
|
|
|
|
enable = true;
|
|
|
|
binfmt = true;
|
|
|
|
};
|
|
|
|
|
2024-07-04 16:27:00 +00:00
|
|
|
environment.sessionVariables = {
|
|
|
|
# Tell Electron apps that they can use Wayland
|
|
|
|
NIXOS_OZONE_WL = "1";
|
|
|
|
# Install full GStreamer capabilities.
|
2024-12-02 02:01:53 +00:00
|
|
|
# References:
|
2024-07-04 16:27:00 +00:00
|
|
|
# https://wiki.nixos.org/wiki/GStreamer
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/195936
|
|
|
|
GST_PLUGIN_SYSTEM_PATH_1_0 = lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" (
|
2024-06-24 15:38:28 +00:00
|
|
|
with pkgs.gst_all_1;
|
|
|
|
[
|
|
|
|
gstreamer
|
|
|
|
gst-plugins-base
|
|
|
|
gst-plugins-good
|
|
|
|
gst-plugins-bad
|
|
|
|
gst-plugins-ugly
|
|
|
|
gst-libav
|
|
|
|
gst-vaapi
|
|
|
|
]
|
|
|
|
);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|