···11{ pkgs, lib, ... }:
22+let # bash script to let dbus know about important env variables and
33+ # propagate them to relevent services run at the end of sway config
44+ # see
55+ # https://github.com/emersion/xdg-desktop-portal-wlr/wiki/"It-doesn't-work"-Troubleshooting-Checklist
66+ # note: this is pretty much the same as /etc/sway/config.d/nixos.conf but also restarts
77+ # some user services to make sure they have the correct environment variables
88+ dbus-sway-environment = pkgs.writeTextFile {
99+ name = "dbus-sway-environment";
1010+ destination = "/bin/dbus-sway-environment";
1111+ executable = true;
1212+1313+ text = ''
1414+ dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
1515+ systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
1616+ systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
1717+ '';
1818+ };
1919+2020+ # currently, there is some friction between sway and gtk:
2121+ # https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
2222+ # the suggested way to set gtk settings is with gsettings
2323+ # for gsettings to work, we need to tell it where the schemas are
2424+ # using the XDG_DATA_DIR environment variable
2525+ # run at the end of sway config
2626+ configure-gtk = pkgs.writeTextFile {
2727+ name = "configure-gtk";
2828+ destination = "/bin/configure-gtk";
2929+ executable = true;
3030+ text = let
3131+ schema = pkgs.gsettings-desktop-schemas;
3232+ datadir = "${schema}/share/gsettings-schemas/${schema.name}";
3333+ in ''
3434+6 gnome_schema=org.gnome.desktop.interface
3535+ gsettings set $gnome_schema gtk-theme 'Dracula'
3636+ '';
3737+ };
3838+in
239{
340441 # List packages installed in system profile. To search, run:
···1350 fzf
1451 qemu
1552 OVMF
5353+5454+ # Sway stuff
5555+ wdisplays
5656+ mako
5757+ bemenu
5858+ wl-clipboard
5959+ slurp
6060+ grim
6161+ swayidle
6262+ swaylock
6363+ gnome3.adwaita-icon-theme
6464+ dracula-theme
6565+ glib
6666+ xdg-utils
6767+ wayland
6868+ configure-gtk
6969+ dbus-sway-environment
7070+ dbus
1671 ];
1772 # Logseq uses an ancient version of Electron, so we enable that
1873 nixpkgs.config.permittedInsecurePackages = [ "electron-25.9.0" ];
19742075 # Whitelist some unfree packages
2176 nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
2222- "jetbrains-toolbox-2.2.1.19765"
2323- "jetbrains-toolbox"
2477 "discord"
2578 "spotify"
2679 "obsidian"