feat: sway configuration

- Change the mod key to Alt.
- Change the keyboard input language to UK.
- Replace dmenu with wofi.
- Disable the laptop screen when used in clam mode (lid closed with an
  external monitor).
- Override the GTK theme to ensure that a dark theme is used in all apps
  (e.g. Firefox).

See:

- https://github.com/swaywm/sway/wiki#clamshell-mode
- https://wiki.archlinux.org/title/Sway#Keymap
This commit is contained in:
Oliver Davies 2023-05-23 11:59:07 +01:00
parent 581dc96157
commit 807e8f177c
4 changed files with 56 additions and 9 deletions
system/nixos/nixedo

View file

@ -4,7 +4,22 @@
{ config, pkgs, ... }:
let nixpkgs = import ../../shared/nixpkgs.nix { };
let
nixpkgs = import ../../shared/nixpkgs.nix { };
configure-gtk = pkgs.writeTextFile {
name = "configure-gtk";
destination = "/bin/configure-gtk";
executable = true;
text = let
schema = pkgs.gsettings-desktop-schemas;
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
in ''
export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS
gnome_schema=org.gnome.desktop.interface
gsettings set $gnome_schema gtk-theme 'Breeze Dark'
'';
};
in {
nixpkgs = nixpkgs;
@ -103,14 +118,22 @@ in {
# $ nix search wget
environment.systemPackages = with pkgs;
[
configure-gtk
swayidle
swaylock
];
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
};
xdg.portal = {
enable = true;
wlr.enable = true;
# gtk portal needed to make gtk apps happy
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.