2019-12-16 08:54:46 +01:00
|
|
|
{ lib, config, options, pkgs, ... }:
|
|
|
|
let
|
2020-01-04 06:06:31 +01:00
|
|
|
inherit (builtins) readFile;
|
|
|
|
|
|
|
|
inherit (config.hardware) pulseaudio;
|
2020-07-31 06:17:28 +02:00
|
|
|
in
|
|
|
|
{
|
2020-01-04 06:06:31 +01:00
|
|
|
imports = [ ../qutebrowser ];
|
2020-01-04 05:19:53 +01:00
|
|
|
|
|
|
|
sound.enable = true;
|
|
|
|
|
2019-12-16 08:54:46 +01:00
|
|
|
programs.sway = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
extraSessionCommands = ''
|
|
|
|
export SDL_VIDEODRIVER=wayland
|
|
|
|
# needs qt5.qtwayland in systemPackages
|
|
|
|
export QT_QPA_PLATFORM=wayland
|
|
|
|
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
|
|
|
|
# Fix for some Java AWT applications (e.g. Android Studio),
|
|
|
|
# use this if they aren't displayed properly:
|
|
|
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
|
|
|
'';
|
|
|
|
|
2020-01-04 06:06:31 +01:00
|
|
|
extraPackages = with pkgs;
|
|
|
|
options.programs.sway.extraPackages.default ++ [
|
|
|
|
dmenu
|
|
|
|
networkmanager_dmenu
|
|
|
|
qt5.qtwayland
|
|
|
|
alacritty
|
|
|
|
volnoti
|
|
|
|
wl-clipboard
|
|
|
|
(waybar.override { pulseSupport = pulseaudio.enable; })
|
2020-01-30 18:12:24 +01:00
|
|
|
grim
|
|
|
|
slurp
|
2020-01-04 06:06:31 +01:00
|
|
|
];
|
2019-12-16 08:54:46 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
environment.etc = {
|
2020-06-17 22:23:37 +02:00
|
|
|
"sway/config".text =
|
|
|
|
let volnoti = import ../misc/volnoti.nix { inherit pkgs; };
|
2020-07-31 06:17:28 +02:00
|
|
|
in
|
|
|
|
''
|
2020-06-17 22:23:37 +02:00
|
|
|
set $volume ${volnoti}
|
2020-06-26 05:54:34 +02:00
|
|
|
set $mixer "${pkgs.alsaUtils}/bin/amixer -q set Master"
|
2019-12-16 08:54:46 +01:00
|
|
|
|
2020-06-17 22:23:37 +02:00
|
|
|
# set background
|
|
|
|
output * bg ${pkgs.adapta-backgrounds}/share/backgrounds/adapta/tri-fadeno.jpg fill
|
2019-12-16 08:54:46 +01:00
|
|
|
|
2020-06-17 22:23:37 +02:00
|
|
|
${readFile ./config}
|
|
|
|
'';
|
2019-12-16 08:54:46 +01:00
|
|
|
|
|
|
|
"xdg/waybar".source = ./waybar;
|
|
|
|
};
|
|
|
|
|
2020-06-09 18:38:34 +02:00
|
|
|
programs.tmux.extraConfig = lib.mkBefore ''
|
2019-12-16 10:21:06 +01:00
|
|
|
set -g @override_copy_command 'wl-copy'
|
|
|
|
'';
|
|
|
|
|
2019-12-16 08:54:46 +01:00
|
|
|
services.redshift = {
|
|
|
|
enable = true;
|
|
|
|
temperature.night = 3200;
|
|
|
|
};
|
|
|
|
|
|
|
|
location = {
|
|
|
|
latitude = 38.833881;
|
|
|
|
longitude = -104.821365;
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.user.targets.sway-session = {
|
|
|
|
enable = true;
|
|
|
|
description = "sway compositor session";
|
|
|
|
documentation = [ "man:systemd.special(7)" ];
|
|
|
|
|
|
|
|
bindsTo = [ "graphical-session.target" ];
|
|
|
|
wants = [ "graphical-session-pre.target" ];
|
|
|
|
after = [ "graphical-session-pre.target" ];
|
|
|
|
requiredBy = [ "graphical-session.target" "graphical-session-pre.target" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.user.services.volnoti = {
|
|
|
|
enable = true;
|
|
|
|
description = "volnoti volume notification";
|
|
|
|
documentation = [ "volnoti --help" ];
|
|
|
|
wantedBy = [ "sway-session.target" ];
|
|
|
|
|
2020-01-04 06:06:31 +01:00
|
|
|
script = "${pkgs.volnoti}/bin/volnoti -n";
|
2019-12-16 08:54:46 +01:00
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
Restart = "always";
|
|
|
|
RestartSec = 3;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|