ops/nixos: add wayland support

This commit is contained in:
Luke Granger-Brown 2021-05-05 22:13:27 +01:00
parent 561501afb7
commit 1c571d965a
7 changed files with 94 additions and 26 deletions

View file

@ -8,7 +8,7 @@ let
in { in {
imports = [ imports = [
../lib/zfs.nix ../lib/zfs.nix
../lib/graphical-client.nix ../lib/graphical-client-wayland.nix
../lib/whitby-distributed.nix ../lib/whitby-distributed.nix
]; ];
@ -96,14 +96,12 @@ in {
]; ];
# Enable the X11 windowing system. # Enable the X11 windowing system.
services.xserver.enable = true; programs.sway = {
services.xserver.layout = "us";
services.xserver.libinput.enable = true;
services.xserver.windowManager.i3.enable = true;
services.xserver.videoDrivers = [ "intel" ];
services.xserver.displayManager.gdm = {
enable = true; enable = true;
wrapperFeatures.gtk = true;
}; };
services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = true;
hardware.opengl.driSupport32Bit = true; hardware.opengl.driSupport32Bit = true;
hardware.opengl.extraPackages = with pkgs; [ hardware.opengl.extraPackages = with pkgs; [

View 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 ];
};
}

View 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 ];
};
}

View 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"; }
];
};
};
}

View 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; }
];
};
};
}

View file

@ -98,22 +98,4 @@
imageDirectory = "${depot.nix.pkgs.lukegb-wallpapers}"; imageDirectory = "${depot.nix.pkgs.lukegb-wallpapers}";
interval = null; 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; }
];
};
};
} }

View file

@ -18,7 +18,7 @@ let
in { in {
imports = [ imports = [
../lib/zfs.nix ../lib/zfs.nix
../lib/graphical-client.nix ../lib/graphical-client-x11.nix
../lib/whitby-distributed.nix ../lib/whitby-distributed.nix
../lib/quotes.bfob.gg.nix ../lib/quotes.bfob.gg.nix