panacea/modules/gui.nix

119 lines
2.4 KiB
Nix
Raw Normal View History

2020-04-22 22:13:03 +02:00
{ config, lib, pkgs, ... }:
2020-09-06 01:46:14 +02:00
let
tmux_config = builtins.readFile /home/coolneng/.tmux.conf;
# Fetch old version of waybar
pinnedpkgs = import (builtins.fetchGit {
name = "my-old-revision";
url = "https://github.com/nixos/nixpkgs-channels/";
ref = "refs/heads/nixpkgs-unstable";
rev = "c83e13315caadef275a5d074243c67503c558b3b";
}) { };
old-waybar = pinnedpkgs.waybar;
in {
2020-04-22 22:13:03 +02:00
# Display manager
services.xserver.enable = true;
2020-05-08 21:53:52 +02:00
services.xserver.displayManager = {
2020-04-22 22:13:03 +02:00
defaultSession = "sway";
autoLogin = {
enable = true;
user = "coolneng";
};
lightdm = {
2020-04-22 22:13:03 +02:00
enable = true;
greeter.package = pkgs.lightdm_gtk_greeter;
2020-04-22 22:13:03 +02:00
};
};
# Window manager
programs.sway = {
enable = true;
2020-09-06 01:46:14 +02:00
extraPackages = [
pkgs.xwayland
pkgs.swaylock
pkgs.swayidle
pkgs.swaybg
pkgs.rofi
old-waybar
pkgs.clipman
pkgs.wl-clipboard
pkgs.grim
pkgs.slurp
pkgs.light
pkgs.imv
pkgs.kanshi
pkgs.kitty
2020-04-22 22:13:03 +02:00
];
extraSessionCommands = ''
2020-05-16 05:20:59 +02:00
export MOZ_ENABLE_WAYLAND=1
export MOZ_DBUS_REMOTE=1
2020-04-22 22:13:03 +02:00
export GRIM_DEFAULT_DIR=/home/coolneng/Photos/Screenshots
export _JAVA_AWT_WM_NONREPARENTING=1
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
export SDL_VIDEODRIVER=wayland
export GTK_THEME=Adapta-Eta
2020-04-22 22:13:03 +02:00
'';
};
2020-05-10 03:13:30 +02:00
2020-05-09 18:45:10 +02:00
# Backlight
programs.light.enable = true;
2020-04-22 22:13:03 +02:00
# Blue light filter
location = {
latitude = 35.89;
longitude = -5.32;
provider = "manual";
};
2020-04-22 22:13:03 +02:00
services.redshift = {
package = pkgs.redshift-wlr;
enable = true;
temperature = {
day = 6500;
night = 5300;
2020-04-22 22:13:03 +02:00
};
};
2020-05-09 18:45:10 +02:00
2020-04-22 22:13:03 +02:00
# Bar
programs.waybar.enable = true;
2020-05-10 03:13:30 +02:00
# GPG agent
programs.gnupg.agent = {
enable = true;
pinentryFlavor = "gtk2";
};
2020-05-15 03:43:23 +02:00
# Tmux
programs.tmux = {
enable = true;
historyLimit = 5000;
keyMode = "vi";
shortcut = "x";
terminal = "screen-256";
baseIndex = 1;
extraConfig = tmux_config;
2020-05-15 03:43:23 +02:00
};
# Automount external storage
services.autofs = {
enable = true;
timeout = 5;
autoMaster = let
mapConf = pkgs.writeText "auto" ''
usb -fstype=auto :/dev/sdb1
sdcard -fstype=auto :/dev/mmcblk0p1
'';
in ''
/media file:${mapConf} --timeout=5
'';
};
2020-07-17 11:25:43 +02:00
# Integrate pass with the browser
programs.browserpass.enable = true;
2020-04-22 22:13:03 +02:00
}