nixos-config/modules/desktop/default.nix

104 lines
2.3 KiB
Nix

{ lib
, pkgs
, config
, ...
}:
with lib; let
cfg = config.eboskma.desktop;
in
{
options.eboskma.desktop = {
enable = mkEnableOption "Enable default desktop configuration";
wayland = mkOption {
description = "Configure for wayland";
type = types.bool;
default = false;
};
};
config = mkIf cfg.enable {
programs = {
dconf.enable = true;
fuse.userAllowOther = true;
seahorse.enable = true;
sway = mkIf cfg.wayland {
enable = true;
wrapperFeatures = {
gtk = true;
base = true;
};
extraPackages = with pkgs; [
swaylock
swayidle
];
};
};
xdg = {
mime.enable = true;
menus.enable = true;
icons.enable = true;
sounds.enable = true;
autostart.enable = true;
portal = {
enable = true;
wlr.enable = cfg.wayland;
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
};
};
services = {
dbus.packages = [ pkgs.gcr ];
avahi.publish.workstation = true;
gvfs.enable = true;
pcscd.enable = true;
ratbagd.enable = true;
teamviewer.enable = mkIf (pkgs.system == "x86_64-linux") true;
};
security = {
pam.services.swaylock = {
unixAuth = true;
setLoginUid = true;
enableGnomeKeyring = true;
allowNullPassword = true;
updateWtmp = true;
startSession = true;
};
pki.certificates = [ (builtins.readFile ./horus-ca.pem) ];
wrappers = {
fusermount.source = "${pkgs.fuse}/bin/fusermount";
};
};
environment = {
sessionVariables = mkMerge [
{
SSH_AUTH_SOCK = ''''${XDG_RUNTIME_DIR}/keyring/ssh'';
}
(mkIf cfg.wayland
{
_JAVA_AWT_WM_NONREPARENTING = "1";
MOZ_ENABLE_WAYLAND = "1";
MOZ_DBUS_REMOTE = "1";
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
QT_QPA_PLATFORMTHEME = "qt5ct";
SDL_VIDEODRIVER = "wayland";
NIXOS_OZONE_WL = "1";
})
];
etc = {
"X11/xkb".source = "${pkgs.xkeyboard_config}/etc/X11/xkb";
};
systemPackages = with pkgs; [
piper
];
};
};
}