84 lines
1.6 KiB
Nix
84 lines
1.6 KiB
Nix
|
{ config
|
||
|
, lib
|
||
|
, options
|
||
|
, pkgs
|
||
|
, ...
|
||
|
}:
|
||
|
let
|
||
|
inherit (lib) types;
|
||
|
cfg = config.mtxyz.desktop;
|
||
|
in
|
||
|
{
|
||
|
options.mtxyz.desktop = {
|
||
|
enable = lib.mkOption {
|
||
|
type = types.bool;
|
||
|
default = false;
|
||
|
};
|
||
|
|
||
|
portable = lib.mkOption {
|
||
|
type = types.bool;
|
||
|
default = false;
|
||
|
};
|
||
|
};
|
||
|
|
||
|
config = lib.mkIf cfg.enable {
|
||
|
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.xserver = {
|
||
|
enable = true;
|
||
|
|
||
|
layout = "us";
|
||
|
xkbOptions = "caps:super";
|
||
|
|
||
|
displayManager.gdm.enable = true;
|
||
|
desktopManager.gnome.enable = true;
|
||
|
libinput.enable = true;
|
||
|
};
|
||
|
|
||
|
services.printing = {
|
||
|
enable = true;
|
||
|
drivers = with pkgs; [ hll2390dw-cups ];
|
||
|
};
|
||
|
|
||
|
programs.kdeconnect = {
|
||
|
enable = true;
|
||
|
package = pkgs.gnomeExtensions.gsconnect;
|
||
|
};
|
||
|
|
||
|
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 = lib.mkIf cfg.portable {
|
||
|
enable = true;
|
||
|
settings = {
|
||
|
START_CHARGE_THRESH_BAT0 = 70;
|
||
|
STOP_CHARGE_THRESH_BAT0 = 80;
|
||
|
};
|
||
|
};
|
||
|
services.power-profiles-daemon.enable = !config.services.tlp.enable;
|
||
|
}
|