diff --git a/ops/nixos/howl/default.nix b/ops/nixos/howl/default.nix index ceae349ca8..fab3662742 100644 --- a/ops/nixos/howl/default.nix +++ b/ops/nixos/howl/default.nix @@ -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; [ diff --git a/ops/nixos/lib/graphical-client-wayland.nix b/ops/nixos/lib/graphical-client-wayland.nix new file mode 100644 index 0000000000..b584995ae4 --- /dev/null +++ b/ops/nixos/lib/graphical-client-wayland.nix @@ -0,0 +1,17 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# 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 ]; + }; +} diff --git a/ops/nixos/lib/graphical-client-x11.nix b/ops/nixos/lib/graphical-client-x11.nix new file mode 100644 index 0000000000..932ffc2538 --- /dev/null +++ b/ops/nixos/lib/graphical-client-x11.nix @@ -0,0 +1,17 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# 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 ]; + }; +} diff --git a/ops/nixos/lib/home-manager/graphical-client-wayland.nix b/ops/nixos/lib/home-manager/graphical-client-wayland.nix new file mode 100644 index 0000000000..a3cd1905d6 --- /dev/null +++ b/ops/nixos/lib/home-manager/graphical-client-wayland.nix @@ -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"; } + ]; + }; + }; +} diff --git a/ops/nixos/lib/home-manager/graphical-client-x11.nix b/ops/nixos/lib/home-manager/graphical-client-x11.nix new file mode 100644 index 0000000000..bae68d6e34 --- /dev/null +++ b/ops/nixos/lib/home-manager/graphical-client-x11.nix @@ -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; } + ]; + }; + }; +} diff --git a/ops/nixos/lib/home-manager/graphical-client.nix b/ops/nixos/lib/home-manager/graphical-client.nix index 20744a218d..da8b707c84 100644 --- a/ops/nixos/lib/home-manager/graphical-client.nix +++ b/ops/nixos/lib/home-manager/graphical-client.nix @@ -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; } - ]; - }; - }; } diff --git a/ops/nixos/porcorosso/default.nix b/ops/nixos/porcorosso/default.nix index 7ab72e35f3..dc4e0220a1 100644 --- a/ops/nixos/porcorosso/default.nix +++ b/ops/nixos/porcorosso/default.nix @@ -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