ops/nixos: add wayland support
This commit is contained in:
parent
561501afb7
commit
1c571d965a
7 changed files with 94 additions and 26 deletions
|
@ -8,7 +8,7 @@ let
|
|||
in {
|
||||
imports = [
|
||||
../lib/zfs.nix
|
||||
../lib/graphical-client.nix
|
||||
../lib/graphical-client-wayland.nix
|
||||
../lib/whitby-distributed.nix
|
||||
];
|
||||
|
||||
|
@ -96,14 +96,12 @@ in {
|
|||
];
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver.enable = true;
|
||||
services.xserver.layout = "us";
|
||||
services.xserver.libinput.enable = true;
|
||||
services.xserver.windowManager.i3.enable = true;
|
||||
services.xserver.videoDrivers = [ "intel" ];
|
||||
services.xserver.displayManager.gdm = {
|
||||
programs.sway = {
|
||||
enable = true;
|
||||
wrapperFeatures.gtk = true;
|
||||
};
|
||||
services.xserver.enable = true;
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
hardware.opengl.extraPackages = with pkgs; [
|
||||
|
|
17
ops/nixos/lib/graphical-client-wayland.nix
Normal file
17
ops/nixos/lib/graphical-client-wayland.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
{ pkgs, depot, lib, ... }:
|
||||
let
|
||||
inherit (lib) mkBefore;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./graphical-client.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
my.home-manager.imports = lib.mkAfter [ ./home-manager/graphical-client-wayland.nix ];
|
||||
};
|
||||
}
|
17
ops/nixos/lib/graphical-client-x11.nix
Normal file
17
ops/nixos/lib/graphical-client-x11.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
{ pkgs, depot, lib, ... }:
|
||||
let
|
||||
inherit (lib) mkBefore;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./graphical-client.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
my.home-manager.imports = lib.mkAfter [ ./home-manager/graphical-client-x11.nix ];
|
||||
};
|
||||
}
|
32
ops/nixos/lib/home-manager/graphical-client-wayland.nix
Normal file
32
ops/nixos/lib/home-manager/graphical-client-wayland.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ pkgs, depot, lib, config, ... }:
|
||||
{
|
||||
imports = [ ./graphical-client.nix ];
|
||||
|
||||
home.packages = lib.mkAfter (with pkgs; [
|
||||
swaylock
|
||||
swayidle
|
||||
wl-clipboard
|
||||
waybar
|
||||
mako
|
||||
kanshi
|
||||
]);
|
||||
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
wrapperFeatures.gtk = true;
|
||||
config = {
|
||||
modifier = "Mod4";
|
||||
keybindings = let
|
||||
modifier = config.wayland.windowManager.sway.config.modifier;
|
||||
in lib.mkOptionDefault {
|
||||
"${modifier}+l" = "exec loginctl lock-session";
|
||||
"${modifier}+p" = "exec ${depot.nix.pkgs.flameshot}/bin/flameshot gui";
|
||||
"${modifier}+Return" = "exec ${pkgs.alacritty}/bin/alacritty";
|
||||
};
|
||||
startup = [
|
||||
{ command = "xss-lock --transfer-sleep-lock -- ${pkgs.swaylock}/bin/swaylock"; }
|
||||
{ command = "${pkgs.gnome3.networkmanagerapplet}/bin/nm-applet"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
22
ops/nixos/lib/home-manager/graphical-client-x11.nix
Normal file
22
ops/nixos/lib/home-manager/graphical-client-x11.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ pkgs, depot, lib, config, ... }:
|
||||
{
|
||||
imports = [ ./graphical-client.nix ];
|
||||
|
||||
xsession.windowManager.i3 = {
|
||||
enable = true;
|
||||
config = {
|
||||
modifier = "Mod4";
|
||||
keybindings = let
|
||||
modifier = config.xsession.windowManager.i3.config.modifier;
|
||||
in lib.mkOptionDefault {
|
||||
"${modifier}+l" = "exec loginctl lock-session";
|
||||
"${modifier}+p" = "exec ${depot.nix.pkgs.flameshot}/bin/flameshot gui";
|
||||
"${modifier}+Return" = "exec ${pkgs.alacritty}/bin/alacritty";
|
||||
};
|
||||
startup = [
|
||||
{ command = "xss-lock --transfer-sleep-lock -- i3lock --nofork"; notification = false; }
|
||||
{ command = "${pkgs.gnome3.networkmanagerapplet}/bin/nm-applet"; notification = false; }
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -98,22 +98,4 @@
|
|||
imageDirectory = "${depot.nix.pkgs.lukegb-wallpapers}";
|
||||
interval = null;
|
||||
};
|
||||
|
||||
xsession.windowManager.i3 = {
|
||||
enable = true;
|
||||
config = {
|
||||
modifier = "Mod4";
|
||||
keybindings = let
|
||||
modifier = config.xsession.windowManager.i3.config.modifier;
|
||||
in lib.mkOptionDefault {
|
||||
"${modifier}+l" = "exec loginctl lock-session";
|
||||
"${modifier}+p" = "exec ${depot.nix.pkgs.flameshot}/bin/flameshot gui";
|
||||
"${modifier}+Return" = "exec ${pkgs.alacritty}/bin/alacritty";
|
||||
};
|
||||
startup = [
|
||||
{ command = "xss-lock --transfer-sleep-lock -- i3lock --nofork"; notification = false; }
|
||||
{ command = "${pkgs.gnome3.networkmanagerapplet}/bin/nm-applet"; notification = false; }
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ let
|
|||
in {
|
||||
imports = [
|
||||
../lib/zfs.nix
|
||||
../lib/graphical-client.nix
|
||||
../lib/graphical-client-x11.nix
|
||||
../lib/whitby-distributed.nix
|
||||
|
||||
../lib/quotes.bfob.gg.nix
|
||||
|
|
Loading…
Reference in a new issue