nixos-config/modules/desktop/default.nix

84 lines
1.8 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;
};
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;
};
security = {
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";
GDK_BACKEND = "wayland";
SDL_VIDEODRIVER = "wayland";
NIXOS_OZONE_WL = "1";
})
];
etc = {
"X11/xkb".source = "${pkgs.xkeyboard_config}/etc/X11/xkb";
};
systemPackages = with pkgs; [
piper
yubikey-manager
];
};
};
}