Files
nixos-configs/roles/desktop/default.nix
2025-02-07 07:18:09 -08:00

92 lines
1.9 KiB
Nix

{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.roles.desktop;
customPackages = pkgs.callPackage ../../packages {};
basePackages = with pkgs; [
#bambu-studio
brightnessctl
emacs-nox
];
x11BasePackages = with pkgs; [
];
x11OnlyPackages = with pkgs; [
];
waylandBasePackages = with pkgs; [
grim
slurp
wl-clipboard
mako
];
waylandOnlyPackages = with pkgs; [
];
in
{
options.roles.desktop = {
enable = mkEnableOption "Enable the desktop role";
x11Only = mkOption {
type = types.bool;
default = false;
};
waylandOnly = mkOption {
type = types.bool;
default = false;
};
};
config = mkIf cfg.enable
{
services.xserver.xkb = {
layout = "us";
variant = "";
options = "caps:escape";
};
services.xserver.enable = true;
services.displayManager.sddm = {
enable = true;
wayland.enable = !cfg.x11Only;
};
services.desktopManager.plasma6.enable = true;
services.xserver.windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [
dmenu
i3status
i3lock
];
};
programs.dconf.enable = true;
services.gnome.gnome-keyring.enable = true;
programs.sway = mkIf (!cfg.x11Only) {
enable = true;
wrapperFeatures.gtk = true;
};
programs.light.enable = mkIf (!cfg.x11Only) true;
programs.kdeconnect.enable = true;
virtualisation.docker.enable = true;
users.extraGroups.docker.members = [ "johno" ];
environment.systemPackages = with pkgs; mkMerge [
basePackages
(mkIf (!cfg.waylandOnly) x11BasePackages)
(mkIf cfg.x11Only x11OnlyPackages)
(mkIf (!cfg.x11Only) waylandBasePackages)
(mkIf (cfg.waylandOnly) waylandOnlyPackages)
];
};
}