84 lines
2 KiB
Nix
84 lines
2 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
inherit (lib) types;
|
|
cfg = config.mtxyz;
|
|
in
|
|
{
|
|
options.mtxyz.graphical = with lib; {
|
|
desktop = mkOption {
|
|
description = "Graphical desktop environment to use";
|
|
type = with types; nullOr (enum ["kde" "gnome" ]);
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf (!isNull cfg.graphical.desktop) (lib.mkMerge [
|
|
# Config for all desktops
|
|
{
|
|
sound.enable = true;
|
|
hardware.pulseaudio.enable = false;
|
|
services.pipewire = {
|
|
enable = true;
|
|
pulse.enable = true;
|
|
alsa.enable = true;
|
|
jack.enable = true;
|
|
};
|
|
|
|
networking.networkmanager.enable = lib.mkDefault true;
|
|
services.avahi = {
|
|
enable = true;
|
|
nssmdns4 = true;
|
|
};
|
|
|
|
virtualisation.waydroid.enable = lib.mkDefault (!cfg.platform.minimal);
|
|
services.flatpak.enable = lib.mkDefault (!cfg.platform.minimal);
|
|
|
|
services.xserver = {
|
|
enable = true;
|
|
|
|
xkb = {
|
|
layout = "us";
|
|
options = "caps:super";
|
|
};
|
|
|
|
libinput.enable = true;
|
|
};
|
|
|
|
services.printing = {
|
|
enable = true;
|
|
drivers = with pkgs; [ hll2390dw-cups ];
|
|
};
|
|
|
|
fonts = {
|
|
enableDefaultPackages = true;
|
|
|
|
packages = with pkgs; [
|
|
(nerdfonts.override {
|
|
fonts = [ "SourceCodePro" "FantasqueSansMono" ];
|
|
})
|
|
];
|
|
|
|
fontconfig = {
|
|
defaultFonts = {
|
|
sansSerif = [ "FantasqueSansMono Nerd Font Mono" ];
|
|
monospace = [ "FantasqueSansMono Nerd Font Mono" ];
|
|
};
|
|
};
|
|
};
|
|
|
|
services.tlp = {
|
|
enable = cfg.platform.portable;
|
|
settings = lib.mkDefault {
|
|
START_CHARGE_THRESH_BAT0 = 70;
|
|
STOP_CHARGE_THRESH_BAT0 = 80;
|
|
};
|
|
};
|
|
services.power-profiles-daemon.enable = !config.services.tlp.enable;
|
|
}
|
|
]);
|
|
}
|