nixfiles/nixos/modules/gui.nix

93 lines
2.1 KiB
Nix
Raw Permalink Normal View History

2022-09-09 01:04:25 +01:00
{ lib, pkgs, config, ... }:
let
inherit (lib) optional mkIf mkDefault mkMerge;
inherit (lib.my) mkBoolOpt';
cfg = config.my.gui;
in
{
options.my.gui = with lib.types; {
enable = mkBoolOpt' true "Whether to enable GUI system options.";
};
config = mkIf cfg.enable {
hardware = {
2024-11-30 17:45:59 +00:00
graphics.enable = mkDefault true;
2022-09-09 01:04:25 +01:00
};
2022-09-09 18:57:14 +01:00
systemd = {
tmpfiles.rules = [
"d /tmp/screenshots 0777 root root"
];
};
2023-08-27 20:04:53 +01:00
security = {
polkit.enable = true;
2024-06-06 02:30:22 +01:00
pam.services.swaylock-plugin = {};
2023-08-27 20:04:53 +01:00
};
2023-04-23 19:13:54 +01:00
2023-04-23 23:44:55 +01:00
environment.systemPackages = with pkgs; [
# for pw-jack
pipewire.jack
2024-06-06 02:30:22 +01:00
swaylock-plugin
2023-04-23 23:44:55 +01:00
];
2022-09-09 01:04:25 +01:00
services = {
pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
jack.enable = true;
};
2023-02-12 15:20:19 +00:00
dbus = {
packages = with pkgs; [ gcr ];
};
gnome = {
gnome-keyring.enable = true;
};
udev = {
extraRules = ''
2023-06-24 13:44:13 +01:00
# Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0664", GROUP="wheel"
2023-06-24 13:44:13 +01:00
# Nintendo
SUBSYSTEM=="usb", ATTR{idVendor}=="057e", MODE="0664", GROUP="wheel"
2024-05-11 00:46:13 +01:00
# FT
SUBSYSTEM=="usb", ATTR{idVendor}=="0403", MODE="0664", GROUP="wheel"
2024-12-11 17:17:33 +00:00
# /dev/player0
SUBSYSTEM=="usb", ATTR{idVendor}=="6969", MODE="0664", GROUP="wheel"
'';
};
2022-09-09 01:04:25 +01:00
};
2022-09-09 14:11:34 +01:00
programs.dconf.enable = true;
2022-09-09 17:47:27 +01:00
fonts.packages = with pkgs; [
2022-09-09 17:47:27 +01:00
dejavu_fonts
freefont_ttf
gyre-fonts # TrueType substitutes for standard PostScript fonts
liberation_ttf
unifont
noto-fonts-emoji
];
2022-09-09 18:57:14 +01:00
xdg = {
portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
];
2022-09-09 18:57:14 +01:00
# For sway
wlr.enable = true;
configPackages = [
(pkgs.writeTextDir "share/xdg-desktop-portal/sway-portals.conf" ''
[preferred]
default=gtk
org.freedesktop.impl.portal.Screenshot=wlr
org.freedesktop.impl.portal.ScreenCast=wlr
'')
];
2022-09-09 18:57:14 +01:00
};
};
2022-09-09 01:04:25 +01:00
};
}