sway: Fully move to home-manager (where possible)

This commit is contained in:
Simon Bruder 2020-11-07 15:04:49 +01:00
parent f02590d824
commit fa231a7196
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F
3 changed files with 32 additions and 52 deletions

View file

@ -5,9 +5,4 @@
console.keyMap = "de";
time.timeZone = "Europe/Berlin";
location = {
latitude = 49.52;
longitude = 10.17;
};
}

View file

@ -1,44 +1,7 @@
{ config, pkgs, ... }:
{
programs.sway = {
enable = true;
extraPackages = with pkgs; [
swaylock # lockscreen
swayidle # autolock
xwayland # for legacy apps
unstable.waybar # better status bar FIXME: 0.9.3 is broken, 0.9.4 from unstable works
mako # notification daemon
#kanshi # autorandr
alacritty # temrinal
dmenu-wayland # launcher
brightnessctl # control screen brightness
#redshift-wlr # natural color temperature
sway-contrib.grimshot # screenshots
];
extraSessionCommands = ''
export CLUTTER_BACKEND=wayland
export GDK_BACKEND=wayland
export MOZ_ENABLE_WAYLAND=1
export QT_QPA_PLATFORM=wayland-egl
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
export SDL_VIDEODRIVER=wayland
export WLR_NO_HARDWARE_CURSORS=1
export _JAVA_AWT_WM_NONREPARENTING=1
'';
};
services.redshift = {
enable = true;
package = pkgs.redshift-wlr;
extraOptions = [ "-v" "-m" "wayland" ];
temperature = {
day = 6500;
night = 3500;
};
};
systemd.user.targets.graphical-session.wantedBy = [ "multi-user.target" ];
programs.sway.enable = true; # actual configuration happens in home-manager
services.logind.lidSwitchDocked = config.services.logind.lidSwitch;
}

View file

@ -215,6 +215,25 @@ in
export _JAVA_AWT_WM_NONREPARENTING=1
'';
};
# Start on tty1
home.file = {
".zprofile".text = ''
if [[ -z $WAYLAND_DISPLAY ]] && [[ $(tty) = /dev/tty1 ]] && command -v sway >/dev/null ; then
systemctl --user start graphical-session.target
export XDG_SESSION_TYPE="wayland"
exec sway
fi
'';
};
home.packages = with pkgs; [
alacritty # terminal
brightnessctl # control screen brightness
sway-contrib.grimshot # screenshots
unstable.waybar # better status bar FIXME: 0.9.3 is broken, 0.9.4 from unstable works
];
xdg.configFile = {
# home-managers waybar module performs additional checks that are overly strict
"waybar/config".text = builtins.toJSON {
@ -379,15 +398,6 @@ in
src = ../files/waybar/style.css;
} // solarized);
};
home.file = {
".zprofile".text = ''
if [[ -z $WAYLAND_DISPLAY ]] && [[ $(tty) = /dev/tty1 ]] && command -v sway >/dev/null ; then
systemctl --user start graphical-session.target
export XDG_SESSION_TYPE="wayland"
exec sway
fi
'';
};
programs.mako = {
enable = true;
@ -401,4 +411,16 @@ in
defaultTimeout = 5000;
};
services.redshift = {
enable = true;
package = pkgs.redshift-wlr;
extraOptions = [ "-v" "-m" "wayland" ];
latitude = "49.52";
longitude = "10.17";
temperature = {
day = 6500;
night = 3500;
};
};
}