nixos-config/modules/desktop/default.nix

85 lines
1.8 KiB
Nix
Raw Normal View History

2024-02-05 11:46:52 +01:00
{
lib,
pkgs,
config,
...
2022-03-01 22:19:03 +01:00
}:
2024-02-05 11:46:52 +01:00
with lib;
let
2021-11-22 08:04:54 +01:00
cfg = config.eboskma.desktop;
in
{
2021-11-12 17:10:17 +01:00
options.eboskma.desktop = {
enable = mkEnableOption "Enable default desktop configuration";
2022-11-11 11:54:21 +01:00
wayland = mkOption {
description = "Configure for wayland";
type = types.bool;
2021-11-12 17:10:17 +01:00
default = false;
};
};
config = mkIf cfg.enable {
2021-11-21 19:07:12 +01:00
programs = {
dconf.enable = true;
fuse.userAllowOther = true;
2022-01-31 08:10:31 +01:00
seahorse.enable = true;
2021-11-21 19:07:12 +01:00
};
2021-11-17 16:32:18 +01:00
xdg = {
mime.enable = true;
menus.enable = true;
icons.enable = true;
sounds.enable = true;
autostart.enable = true;
portal = {
enable = true;
2022-11-11 11:54:21 +01:00
wlr.enable = cfg.wayland;
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
2021-11-17 16:32:18 +01:00
};
};
services = {
dbus.packages = [ pkgs.gcr ];
2021-12-06 09:58:39 +01:00
avahi.publish.workstation = true;
2022-01-31 08:10:31 +01:00
gvfs.enable = true;
2022-03-18 21:14:51 +01:00
pcscd.enable = true;
ratbagd.enable = true;
2021-11-21 19:07:12 +01:00
};
2021-11-17 16:32:18 +01:00
2021-11-25 17:18:13 +01:00
security = {
pki.certificates = [ (builtins.readFile ./horus-ca.pem) ];
wrappers = {
fusermount.source = "${pkgs.fuse}/bin/fusermount";
};
2021-11-16 00:22:18 +01:00
};
2021-11-22 18:56:59 +01:00
2022-03-18 21:14:51 +01:00
environment = {
sessionVariables = mkMerge [
2024-02-05 11:46:52 +01:00
{ 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";
})
];
2021-11-22 18:56:59 +01:00
2022-03-18 21:14:51 +01:00
etc = {
"X11/xkb".source = "${pkgs.xkeyboard_config}/etc/X11/xkb";
};
systemPackages = with pkgs; [
piper
2023-11-10 16:46:25 +01:00
yubikey-manager
];
2021-12-18 16:23:14 +01:00
};
2021-11-12 17:10:17 +01:00
};
}