nixfiles/nixos/modules/gui.nix

80 lines
1.7 KiB
Nix
Raw 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 = {
opengl.enable = mkDefault true;
};
2022-09-09 18:57:14 +01:00
systemd = {
tmpfiles.rules = [
"d /tmp/screenshots 0777 root root"
];
};
2023-04-23 19:13:54 +01:00
security.polkit.enable = true;
2023-04-23 23:44:55 +01:00
environment.systemPackages = with pkgs; [
# for pw-jack
pipewire.jack
];
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;
};
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.fonts = with pkgs; [
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
nixpkgs.overlays = [
(self: super: {
xdg-desktop-portal = super.xdg-desktop-portal.overrideAttrs (old: rec {
# https://github.com/flatpak/xdg-desktop-portal/issues/861
version = "1.14.6";
src = pkgs.fetchFromGitHub {
owner = "flatpak";
repo = old.pname;
rev = version;
sha256 = "sha256-MD1zjKDWwvVTui0nYPgvVjX48DaHWcP7Q10vDrNKYz0=";
};
});
})
];
xdg = {
portal = {
enable = true;
# For sway
wlr.enable = true;
};
};
2022-09-09 01:04:25 +01:00
};
}