xserver.nix is now desktop.nix; WM's can now be added/removed through machine options. Added sway and some fonts.
This commit is contained in:
parent
4386bc197d
commit
6c744f089e
12 changed files with 337 additions and 38 deletions
|
@ -14,6 +14,6 @@
|
|||
./nginx.nix
|
||||
./openssh.nix
|
||||
./udev.nix
|
||||
./xserver.nix
|
||||
./desktop.nix
|
||||
];
|
||||
}
|
||||
|
|
59
services/desktop.nix
Normal file
59
services/desktop.nix
Normal file
|
@ -0,0 +1,59 @@
|
|||
{ config, lib, 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
|
||||
'';
|
||||
};
|
||||
|
||||
services.gnome3.gvfs.enable = true;
|
||||
environment.variables.GIO_EXTRA_MODULES = [ "${pkgs.gnome3.gvfs}/lib/gio/modules" ];
|
||||
services.xserver = {
|
||||
enable = !(elem "sway" cfg.desktop.wms);
|
||||
layout = "de";
|
||||
videoDrivers = [ "intel" ];
|
||||
windowManager = mkIf (cfg.desktop.wms != []) {
|
||||
i3 = mkIf (elem "i3" cfg.desktop.wms) (import ./desktop/i3.nix { inherit pkgs; });
|
||||
default = elemAt cfg.desktop.wms 0;
|
||||
};
|
||||
# add switch for Lilim
|
||||
libinput = {
|
||||
enable = true;
|
||||
tapping = true;
|
||||
disableWhileTyping = false;
|
||||
naturalScrolling = false;
|
||||
horizontalScrolling = true;
|
||||
};
|
||||
# Still waiting for streamlined dpi settings... will write a propper solution once it's done >.<
|
||||
# see https://github.com/NixOS/nixpkgs/pull/25892
|
||||
dpi = ifelse (cfg.hostName == "Lilim") 192 null;
|
||||
};
|
||||
}
|
0
services/desktop/gnome3.nix
Normal file
0
services/desktop/gnome3.nix
Normal file
16
services/desktop/i3.nix
Normal file
16
services/desktop/i3.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ pkgs }:
|
||||
|
||||
#with lib;
|
||||
|
||||
#mkIf (elem "i3" cfg.xserver.wms) {
|
||||
# i3 =
|
||||
{
|
||||
enable = true;
|
||||
configFile = ../../config/etc/i3/config;
|
||||
extraPackages = with pkgs; [
|
||||
dmenu
|
||||
file
|
||||
i3lock
|
||||
i3status
|
||||
];
|
||||
}
|
29
services/desktop/sway.nix
Normal file
29
services/desktop/sway.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ pkgs }:
|
||||
|
||||
{
|
||||
enable = true;
|
||||
extraPackages = with pkgs; [
|
||||
xwayland
|
||||
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
|
||||
'';
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
mkIf (elem "xserver" config.machine.services) {
|
||||
services.gnome3.gvfs.enable = true;
|
||||
environment.variables.GIO_EXTRA_MODULES = [ "${pkgs.gnome3.gvfs}/lib/gio/modules" ];
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
layout = "de";
|
||||
videoDrivers = [ "intel" ];
|
||||
windowManager = {
|
||||
i3 = {
|
||||
enable = true;
|
||||
configFile = ../config/etc/i3/config;
|
||||
extraPackages = with pkgs; [
|
||||
dmenu
|
||||
file
|
||||
i3lock
|
||||
i3status
|
||||
];
|
||||
};
|
||||
default = "i3";
|
||||
};
|
||||
# add switch for Lilim
|
||||
libinput = {
|
||||
enable = true;
|
||||
tapping = true;
|
||||
disableWhileTyping = false;
|
||||
naturalScrolling = false;
|
||||
horizontalScrolling =true;
|
||||
};
|
||||
dpi = 192;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue