ops/nixos: refactoring for sway

This commit is contained in:
Luke Granger-Brown 2021-05-06 03:56:20 +01:00
parent 1c571d965a
commit b7cd20c769
4 changed files with 127 additions and 94 deletions

View file

@ -13,5 +13,11 @@ in
config = { config = {
my.home-manager.imports = lib.mkAfter [ ./home-manager/graphical-client-wayland.nix ]; my.home-manager.imports = lib.mkAfter [ ./home-manager/graphical-client-wayland.nix ];
xdg.portal = {
enable = true;
gtkUsePortal = true;
extraPortals = with depot.pkgs; [ xdg-desktop-portal-wlr ];
};
}; };
} }

View file

@ -9,24 +9,43 @@
waybar waybar
mako mako
kanshi kanshi
qt5.qtwayland
]); ]);
wayland.windowManager.sway = { wayland.windowManager.sway = {
enable = true; enable = true;
wrapperFeatures.gtk = true; wrapperFeatures.gtk = true;
extraSessionCommands = ''
export SDL_VIDEODRIVER=wayland
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
export XDG_CURRENT_DESKTOP=sway
export MOZ_ENABLE_WAYLAND=1
export MOZ_USE_XINPUT2=1
'';
config = { config = {
modifier = "Mod4"; modifier = "Mod4";
keybindings = let keybindings = let
modifier = config.wayland.windowManager.sway.config.modifier; modifier = config.wayland.windowManager.sway.config.modifier;
in lib.mkOptionDefault { in lib.mkOptionDefault {
"${modifier}+l" = "exec loginctl lock-session"; "${modifier}+l" = "exec ${pkgs.swaylock}/bin/swaylock";
"${modifier}+p" = "exec ${depot.nix.pkgs.flameshot}/bin/flameshot gui"; "${modifier}+p" = "exec ${depot.nix.pkgs.flameshot}/bin/flameshot gui";
"${modifier}+Return" = "exec ${pkgs.alacritty}/bin/alacritty"; "${modifier}+Return" = "exec ${pkgs.alacritty}/bin/alacritty";
}; };
startup = [ startup = [
{ command = "xss-lock --transfer-sleep-lock -- ${pkgs.swaylock}/bin/swaylock"; }
{ command = "${pkgs.gnome3.networkmanagerapplet}/bin/nm-applet"; }
]; ];
output."*".bg = "${depot.pkgs.lukegb-wallpapers}/lunik1-gruvbox-dark-rainbow.png fill";
# howl: tap-to-click
input."1739:24385:Synaptics_TM2438-005" = {
tap = "enabled";
tap_button_map = "lrm";
middle_emulation = "enabled";
}; };
}; };
};
my.alacritty.fontSize = 12;
} }

View file

@ -19,4 +19,10 @@
]; ];
}; };
}; };
services.random-background = {
enable = true;
imageDirectory = "${depot.nix.pkgs.lukegb-wallpapers}";
interval = null;
};
} }

View file

@ -2,6 +2,14 @@
{ {
imports = [ ./client.nix ]; imports = [ ./client.nix ];
options.my.alacritty = with lib; {
fontSize = mkOption {
default = 6;
type = types.int;
};
};
config = {
gtk = { gtk = {
enable = true; enable = true;
gtk3.extraConfig = { gtk3.extraConfig = {
@ -39,8 +47,7 @@
bold = iosevka "Bold"; bold = iosevka "Bold";
italic = iosevka "Italic"; italic = iosevka "Italic";
bold_italic = iosevka "Bold Italic"; bold_italic = iosevka "Bold Italic";
size = config.my.alacritty.fontSize;
size = 6;
}; };
settings.colors = { settings.colors = {
# Ayu Dark, from https://github.com/alacritty/alacritty/wiki/Color-schemes # Ayu Dark, from https://github.com/alacritty/alacritty/wiki/Color-schemes
@ -92,10 +99,5 @@
systemctl --user import-environment DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY XDG_DATA_DIRS XDG_RUNTIME_DIR XDG_SESSION_ID systemctl --user import-environment DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY XDG_DATA_DIRS XDG_RUNTIME_DIR XDG_SESSION_ID
systemctl --user restart ssh-agent systemctl --user restart ssh-agent
''; '';
services.random-background = {
enable = true;
imageDirectory = "${depot.nix.pkgs.lukegb-wallpapers}";
interval = null;
}; };
} }