Modularize desktop service and remove desktop.wms from machine opts.
This commit is contained in:
parent
13a25fe675
commit
483c5d3f39
6 changed files with 32 additions and 64 deletions
|
@ -1,47 +1,16 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, fn, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.machine;
|
||||
ifelse = a: b: c: if a then b else c;
|
||||
in mkIf (elem "desktop" cfg.services) {
|
||||
programs.sway = mkIf (elem "sway" cfg.desktop.wms) # (import ./desktop/sway.nix { inherit pkgs; });
|
||||
{
|
||||
enable = true;
|
||||
extraPackages = with pkgs; [
|
||||
file i3status dmenu
|
||||
qt5.qtwayland
|
||||
grim slurp
|
||||
swaylock
|
||||
swayidle
|
||||
light
|
||||
mako
|
||||
wl-clipboard
|
||||
wf-recorder
|
||||
];
|
||||
extraSessionCommands = ''
|
||||
export GDK_BACKEND=wayland
|
||||
export CLUTTER_BACKEND=wayland
|
||||
export SDL_VIDEODRIVER=wayland
|
||||
# needs qt5.qtwayland in systemPackages
|
||||
export QT_QPA_PLATFORM=wayland-egl
|
||||
export QT_WAYLAND_FORCE_DPI=physical
|
||||
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
|
||||
'';
|
||||
};
|
||||
|
||||
desktopFiles = fn.lst { p = (toString ./desktop); b = true; };
|
||||
in {
|
||||
imports = desktopFiles;
|
||||
} // mkIf (elem "desktop" cfg.services) {
|
||||
services.gvfs.enable = true;
|
||||
services.xserver = {
|
||||
enable = !(elem "sway" cfg.desktop.wms);
|
||||
layout = "de";
|
||||
displayManager.defaultSession = ifelse (cfg.desktop.wms != []) (elemAt cfg.desktop.wms 0) null;
|
||||
windowManager = mkIf (cfg.desktop.wms != []) {
|
||||
i3 = mkIf (elem "i3" cfg.desktop.wms) (import ./desktop/i3.nix { inherit pkgs; });
|
||||
};
|
||||
libinput = {
|
||||
enable = true;
|
||||
touchpad = {
|
||||
|
@ -56,5 +25,4 @@ in mkIf (elem "desktop" cfg.services) {
|
|||
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness"
|
||||
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod 664 /sys/class/backlight/%k/brightness"
|
||||
'';
|
||||
machine.pkgsets.python3.pkgs = with pkgs.python310Packages; [ py3status pytz tzlocal ];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue