nixos-config/modules/desktop/default.nix
Erwin Boskma 4cd0f83ce8
Some checks failed
/ check (push) Failing after 2m46s
Run nixfmt
2024-02-05 11:46:52 +01:00

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