dotfiles/nixos/roles/graphical.nix

55 lines
1.5 KiB
Nix
Raw Normal View History

2017-02-02 16:31:19 +01:00
let secrets = import <secrets>;
2020-05-21 17:39:38 +02:00
in { config, lib, pkgs, ... }: {
imports = [ ./. ];
2017-02-02 16:31:19 +01:00
options.yorick.support32bit = with lib;
2020-05-21 17:39:38 +02:00
mkOption {
type = types.bool;
default = false;
2018-02-27 16:31:16 +01:00
};
2020-05-21 17:39:38 +02:00
config = {
2018-02-27 16:31:16 +01:00
hardware.opengl = {
enable = true;
driSupport32Bit = config.yorick.support32bit;
};
sound.enable = true;
hardware.pulseaudio = {
enable = true;
support32Bit = config.yorick.support32bit;
};
2020-05-21 17:39:38 +02:00
users.users.yorick.extraGroups = [ "video" ];
2018-02-27 16:31:16 +01:00
# fix backlight permissions
2020-05-21 17:39:38 +02:00
services.udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness"
'';
2015-03-18 02:24:24 +01:00
2020-05-21 17:39:38 +02:00
fonts = {
2021-01-02 20:39:48 +01:00
fontDir.enable = true;
2020-05-21 17:39:38 +02:00
enableGhostscriptFonts = true;
fonts = with pkgs; [
corefonts # Micrsoft free fonts
inconsolata # monospaced
source-code-pro
ubuntu_font_family # Ubuntu fonts
source-han-sans-japanese
iosevka
font-awesome
];
};
# spotify
networking.firewall.allowedTCPPorts = [ 55025 57621 ];
networking.firewall.allowedUDPPorts = [ 55025 57621 ];
services.openssh.forwardX11 = true;
2017-02-02 16:31:19 +01:00
2020-05-21 17:39:38 +02:00
programs.sway = {
enable = true;
extraSessionCommands = ''
2021-05-29 18:05:31 +02:00
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${
lib.makeLibraryPath (with pkgs; [ libxkbcommon libglvnd wayland ])
}
2020-05-21 17:39:38 +02:00
'';
};
};
2015-03-18 02:24:24 +01:00
}