dotfiles/roles/graphical.nix

61 lines
1.7 KiB
Nix
Raw Normal View History

2017-02-02 16:31:19 +01:00
let secrets = import <secrets>;
in
2015-03-18 02:24:24 +01:00
{ config, lib, pkgs, ... }:
{
2018-03-11 19:21:08 +01:00
imports = [ <yori-nix/roles> ];
2017-02-02 16:31:19 +01:00
options.yorick.support32bit = with lib;
mkOption { type = types.bool; default = false; };
config = {
2015-03-18 02:24:24 +01:00
# Enable the X11 windowing system.
services.xserver = {
enable = true;
2017-01-26 14:52:06 +01:00
libinput = {
naturalScrolling = true;
tappingDragLock = false;
};
2015-03-18 02:24:24 +01:00
layout = "us";
xkbOptions = "caps:escape";
2015-03-18 02:24:24 +01:00
displayManager.slim.defaultUser = "yorick";
# xkbOptions = "eurosign:e";
windowManager.i3 = {
enable = true;
package = pkgs.i3-gaps;
2018-02-27 16:31:16 +01:00
};
2015-03-18 02:24:24 +01:00
};
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;
};
users.extraUsers.yorick.extraGroups = ["video"];
# fix backlight permissions
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
fonts = {
enableFontDir = true;
enableGhostscriptFonts = true;
fonts = with pkgs; [
corefonts # Micrsoft free fonts
inconsolata # monospaced
source-code-pro
ubuntu_font_family # Ubuntu fonts
2015-03-23 23:30:40 +01:00
source-han-sans-japanese
2017-04-08 23:20:11 +02:00
iosevka
2015-03-18 02:24:24 +01:00
];
};
# spotify
2018-02-27 16:31:16 +01:00
networking.firewall.allowedTCPPorts = [55025 57621];
networking.firewall.allowedUDPPorts = [55025 57621];
2017-02-02 16:31:19 +01:00
users.extraUsers.yorick.hashedPassword = secrets.yorick_hashedPassword;
2017-02-27 16:20:31 +01:00
services.openssh.forwardX11 = true;
2017-02-02 16:31:19 +01:00
};
2015-03-18 02:24:24 +01:00
}