nixos-config/modules/desktop.nix

92 lines
2.4 KiB
Nix
Raw Normal View History

# This is where extra desktop goodies can be found.
# As a note, this is not where you set the aesthetics of your graphical sessions.
# That can be found in the `themes` module.
{ config, options, lib, pkgs, ... }:
2021-11-25 13:45:48 +00:00
let cfg = config.modules.desktop;
in {
options.modules.desktop = {
2021-11-25 13:45:48 +00:00
enable = lib.mkEnableOption
"Enables all desktop-related services and default programs.";
audio.enable = lib.mkEnableOption
"Enables all desktop audio-related services such as Pipewire.";
fonts.enable = lib.mkEnableOption "Enables font-related config.";
};
2021-11-25 13:45:48 +00:00
config = lib.mkIf cfg.enable (lib.mkMerge [
({
# Enable Flatpak for additional options for installing desktop applications.
services.flatpak.enable = true;
xdg.portal = {
enable = true;
gtkUsePortal = true;
wlr.enable = true;
};
# Enable font-related options for more smoother and consistent experience.
fonts.enableDefaultFonts = true;
})
(lib.mkIf cfg.audio.enable {
# Enable the preferred audio workflow.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
# Enable running GNOME apps outside GNOME.
programs.dconf.enable = true;
# Enable MPD-related services.
services.mpd.enable = true;
2021-11-25 13:45:48 +00:00
environment.systemPackages = with pkgs;
[
ncmpcpp # Has the worst name for a music client WTF?
];
})
(lib.mkIf cfg.fonts.enable {
fonts = {
enableDefaultFonts = true;
fontconfig = {
enable = true;
includeUserConf = true;
2021-11-27 08:04:01 +00:00
defaultFonts = {
monospace = [ "Iosevka" "Source Code Pro" ];
sansSerif = [ "Source Sans Pro" "Noto Sans" ];
serif = [ "Source Serif Pro" "Noto Serif" ];
};
2021-11-25 13:45:48 +00:00
};
2021-11-29 09:58:02 +00:00
fonts = with pkgs; [
iosevka
2021-11-27 08:04:01 +00:00
2021-11-29 09:58:02 +00:00
# Noto font family
noto-fonts
noto-fonts-cjk
noto-fonts-extra
noto-fonts-emoji
2021-11-27 08:04:01 +00:00
2021-11-29 09:58:02 +00:00
# Adobe Source font family
source-code-pro
source-sans-pro
source-han-sans
source-serif-pro
source-han-serif
source-han-mono
2021-11-25 13:45:48 +00:00
2021-11-29 09:58:02 +00:00
# Math fonts
stix-two
xits-math
];
2021-11-25 13:45:48 +00:00
};
})
]);
}