2023-09-24 13:20:34 +02:00
|
|
|
modulesCfg: {
|
2023-09-09 15:44:15 +02:00
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
2023-09-24 13:04:45 +02:00
|
|
|
isEnabled = config.my.desktop.enable;
|
2023-09-24 13:20:34 +02:00
|
|
|
isHomeManager = modulesCfg.enableHomeManager;
|
2023-09-09 15:44:15 +02:00
|
|
|
in {
|
2023-09-24 13:20:34 +02:00
|
|
|
imports =
|
|
|
|
[
|
|
|
|
./gnome.nix
|
|
|
|
./kde.nix
|
|
|
|
./gaming.nix
|
|
|
|
]
|
|
|
|
++ lib.optionals isHomeManager [
|
|
|
|
./gnome-home.nix
|
|
|
|
./kde-home.nix
|
|
|
|
];
|
2023-09-24 10:46:15 +02:00
|
|
|
|
|
|
|
options.my.desktop.enable = lib.mkEnableOption "desktop";
|
2023-09-09 15:44:15 +02:00
|
|
|
|
2023-09-24 13:04:45 +02:00
|
|
|
config = lib.mkIf isEnabled {
|
2023-09-09 15:44:15 +02:00
|
|
|
services = {
|
|
|
|
# Enable the X11 windowing system / wayland depending on DE
|
|
|
|
xserver.enable = true;
|
|
|
|
|
|
|
|
# Enable CUPS to print documents.
|
|
|
|
printing.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Enable sound with pipewire.
|
|
|
|
sound.enable = true;
|
|
|
|
hardware.pulseaudio.enable = false;
|
|
|
|
security.rtkit.enable = true;
|
|
|
|
services.pipewire = {
|
|
|
|
enable = true;
|
|
|
|
alsa.enable = true;
|
|
|
|
alsa.support32Bit = true;
|
|
|
|
pulse.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
programs = {
|
2023-09-24 15:27:13 +02:00
|
|
|
kdeconnect.enable = true;
|
2023-09-09 15:44:15 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
# unblock kde connect / gsconnect
|
2023-09-11 19:16:26 +02:00
|
|
|
networking = {
|
|
|
|
networkmanager.enable = true;
|
|
|
|
firewall.enable = true;
|
|
|
|
|
|
|
|
firewall = {
|
|
|
|
allowedTCPPortRanges = [
|
|
|
|
{
|
|
|
|
# KDE Connect
|
|
|
|
from = 1714;
|
|
|
|
to = 1764;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
allowedUDPPortRanges = [
|
|
|
|
{
|
|
|
|
# KDE Connect
|
|
|
|
from = 1714;
|
|
|
|
to = 1764;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-09-17 14:03:37 +02:00
|
|
|
systemd = {
|
|
|
|
# save some boot time because nothing actually requires network connectivity
|
|
|
|
services.NetworkManager-wait-online.enable = false;
|
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
DefaultTimeoutStopSec=12s
|
|
|
|
'';
|
|
|
|
};
|
2023-09-11 19:16:26 +02:00
|
|
|
|
|
|
|
environment = {
|
|
|
|
systemPackages = with pkgs; [
|
|
|
|
lm_sensors
|
2023-09-09 15:44:15 +02:00
|
|
|
];
|
|
|
|
};
|
2023-09-11 21:00:02 +02:00
|
|
|
|
|
|
|
nixpkgs.config.permittedInsecurePackages = [
|
|
|
|
"electron-12.2.3"
|
|
|
|
];
|
2023-09-17 16:54:18 +02:00
|
|
|
|
|
|
|
fonts = {
|
2023-09-17 16:56:11 +02:00
|
|
|
fontconfig.defaultFonts.monospace = ["FiraCode Nerd Font"];
|
2023-09-17 16:54:18 +02:00
|
|
|
fonts = with pkgs; [
|
|
|
|
(nerdfonts.override {fonts = ["FiraCode"];})
|
|
|
|
];
|
|
|
|
};
|
2023-09-09 15:44:15 +02:00
|
|
|
};
|
|
|
|
}
|