desko: switch to sway compositor

This commit is contained in:
colin 2022-06-03 01:39:11 -07:00
parent 87637bb1a2
commit 75ba43aaca
3 changed files with 63 additions and 2 deletions

22
helpers/gui/sway.nix Normal file
View File

@ -0,0 +1,22 @@
{ pkgs, ... }:
# docs: https://nixos.wiki/wiki/Sway
{
programs.sway = {
# we configure sway with home-manager, but this enable gets us e.g. opengl and fonts
enable = true;
};
# TODO: should be able to use SDDM to get interactive login
services.greetd = {
enable = true;
settings = rec {
initial_session = {
command = "${pkgs.sway}/bin/sway";
user = "colin";
};
default_session = initial_session;
};
};
}

View File

@ -130,6 +130,11 @@
};
};
# home.pointerCursor = {
# package = pkgs.vanilla-dmz;
# name = "Vanilla-DMZ";
# };
# taken from https://github.com/srid/nix-config/blob/705a70c094da53aa50cf560179b973529617eb31/nix/home/i3.nix
xsession.windowManager.i3 = lib.mkIf (gui == "i3") (
let
@ -180,6 +185,27 @@
};
});
wayland.windowManager.sway = lib.mkIf (gui == "sway") {
enable = true;
wrapperFeatures.gtk = true;
config = {
terminal = "${pkgs.kitty}/bin/kitty";
};
# TODO: this might not be necessary (try deleting this and the numix-cursor package)
extraConfig = ''
seat seat0 xcursor_theme Numix-Cursor 18
'';
# extraConfig = ''
# seat seat0 xcursor_theme "Vanilla-DMZ" 32
# '';
# extraSessionCommands = ''
# export XDG_SESSION_TYPE=wayland
# export XDG_SESSION_DESKTOP=sway
# export XDG_CURRENT_DESKTOP=sway
# '';
};
programs.firefox = lib.mkIf (gui != null) {
enable = true;
@ -275,10 +301,21 @@
pkgs.inkscape
pkgs.libreoffice-fresh # XXX colin: maybe don't want this on mobile
pkgs.mesa-demos
pkgs.numix-cursor-theme
pkgs.tdesktop # broken on phosh
pkgs.vlc # works on phosh
pkgs.xterm # broken on phosh
] else [])
++ (if gui == "sway" then
[
# TODO: move this to helpers/gui/sway.nix?
pkgs.swaylock
pkgs.swayidle
pkgs.wl-clipboard
pkgs.mako # notification daemon
pkgs.alacritty # TODO: switch to kitty (in sway config)
pkgs.dmenu # TODO: switch to wofi (in sway config)
] else [])
++ (if gui != null && system == "x86_64-linux" then
[
# x86_64 only

View File

@ -4,7 +4,8 @@
./../../helpers/universal
./../../helpers/hardware-x86_64.nix
# ./../../helpers/gui/gnome.nix
./../../helpers/gui/i3.nix
#./../../helpers/gui/i3.nix
./../../helpers/gui/sway.nix
./fs.nix
];
@ -12,7 +13,8 @@
inherit pkgs lib;
system = "x86_64-linux";
# gui = "gnome";
gui = "i3";
# gui = "i3";
gui = "sway";
extraPackages = [
pkgs.electrum
];