2023-11-10 18:48:06 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
2024-04-07 20:07:42 +00:00
|
|
|
flake,
|
2023-11-10 18:48:06 +00:00
|
|
|
...
|
|
|
|
}:
|
2024-06-13 00:14:25 +00:00
|
|
|
let
|
2023-11-10 18:48:06 +00:00
|
|
|
psCfg = config.pub-solar;
|
2024-06-13 00:14:25 +00:00
|
|
|
inherit (lib) mkIf mkOption types;
|
2023-11-10 18:48:06 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options.pub-solar.graphical = {
|
|
|
|
v4l2loopback.enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "WebCam streaming tool";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
|
|
|
boot = mkIf psCfg.graphical.v4l2loopback.enable {
|
|
|
|
extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
|
|
|
|
kernelModules = [ "v4l2loopback" ];
|
|
|
|
extraModprobeConfig = ''
|
|
|
|
options v4l2loopback exclusive_caps=1 devices=3
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-06-13 00:14:25 +00:00
|
|
|
environment.systemPackages = mkIf psCfg.graphical.v4l2loopback.enable [
|
|
|
|
pkgs.linuxPackages.v4l2loopback
|
2023-11-10 18:48:06 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
programs.sway.enable = true;
|
|
|
|
|
|
|
|
xdg.portal = {
|
|
|
|
enable = true;
|
2024-10-15 13:14:49 +00:00
|
|
|
config.sway = {
|
|
|
|
# https://alex.dandrea.io/2024/07/20/fixing-idle-inhibitor-behaviour-in-firefox-with-wayland/
|
|
|
|
# Use xdg-desktop-portal-gtk for every portal interface...
|
|
|
|
default = "gtk";
|
|
|
|
# ... except for the ScreenCast, Screenshot and Secret
|
|
|
|
"org.freedesktop.impl.portal.ScreenCast" = "wlr";
|
|
|
|
"org.freedesktop.impl.portal.Screenshot" = "wlr";
|
|
|
|
# ignore inhibit bc gtk portal always returns as success,
|
|
|
|
# despite sway/the wlr portal not having an implementation,
|
|
|
|
# stopping firefox from using wayland idle-inhibit
|
|
|
|
"org.freedesktop.impl.portal.Inhibit" = "none";
|
|
|
|
};
|
2023-11-10 18:48:06 +00:00
|
|
|
wlr = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
screencast = {
|
|
|
|
max_fps = 30;
|
|
|
|
chooser_type = "simple";
|
|
|
|
chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
|
|
|
|
};
|
|
|
|
|
|
|
|
services.pipewire.enable = true;
|
|
|
|
|
|
|
|
users.users."${psCfg.user.name}".packages = with pkgs; [
|
|
|
|
sway
|
|
|
|
grim
|
|
|
|
kanshi
|
|
|
|
slurp
|
|
|
|
swaybg
|
|
|
|
swayidle
|
|
|
|
swaynotificationcenter
|
|
|
|
xwayland
|
|
|
|
|
|
|
|
libappindicator-gtk3
|
|
|
|
|
|
|
|
wl-clipboard
|
2024-04-28 18:58:52 +00:00
|
|
|
wl-mirror
|
2023-11-10 18:48:06 +00:00
|
|
|
wf-recorder
|
|
|
|
brightnessctl
|
|
|
|
gammastep
|
|
|
|
geoclue2
|
|
|
|
xsettingsd
|
|
|
|
ydotool
|
|
|
|
|
|
|
|
sway-launcher
|
|
|
|
record-screen
|
|
|
|
import-gtk-settings
|
|
|
|
# Unused on teutat3s hosts, see custom-keybindings.conf
|
|
|
|
#toggle-kbd-layout
|
|
|
|
s
|
|
|
|
wcwd
|
|
|
|
];
|
|
|
|
|
|
|
|
home-manager.users."${psCfg.user.name}" = {
|
2024-04-07 20:07:42 +00:00
|
|
|
imports = [ flake.self.inputs.wayland-pipewire-idle-inhibit.homeModules.default ];
|
|
|
|
|
|
|
|
services.wayland-pipewire-idle-inhibit = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.wayland-pipewire-idle-inhibit;
|
|
|
|
systemdTarget = "sway-session.target";
|
|
|
|
settings = {
|
|
|
|
verbosity = "INFO";
|
|
|
|
media_minimum_duration = 10;
|
|
|
|
idle_inhibitor = "wayland";
|
|
|
|
sink_whitelist = [
|
|
|
|
{ name = "Starship/Matisse HD Audio Controller Analog Stereo"; }
|
2024-04-13 00:17:01 +00:00
|
|
|
{ name = "Built-in Audio Analog Stereo"; }
|
2024-09-12 17:55:52 +00:00
|
|
|
{ name = "MAJOR III BLUETOOTH"; }
|
2024-04-07 20:07:42 +00:00
|
|
|
];
|
|
|
|
node_blacklist = [
|
|
|
|
{ name = "spotify"; }
|
|
|
|
{ app_name = "Music Player Daemon"; }
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2023-11-10 18:48:06 +00:00
|
|
|
programs.waybar.enable = true;
|
|
|
|
#programs.waybar.systemd.enable = true;
|
|
|
|
|
|
|
|
systemd.user.services.swaynotificationcenter = import ./swaynotificationcenter.service.nix pkgs;
|
|
|
|
systemd.user.services.sway = import ./sway.service.nix { inherit pkgs psCfg; };
|
|
|
|
systemd.user.services.swayidle = import ./swayidle.service.nix { inherit pkgs psCfg; };
|
|
|
|
systemd.user.services.xsettingsd = import ./xsettingsd.service.nix { inherit pkgs psCfg; };
|
|
|
|
systemd.user.services.waybar = import ./waybar.service.nix { inherit pkgs psCfg; };
|
|
|
|
systemd.user.targets.sway-session = import ./sway-session.target.nix { inherit pkgs psCfg; };
|
|
|
|
|
|
|
|
xdg.configFile."sway/config".text = import ./config/config.nix { inherit config pkgs; };
|
|
|
|
xdg.configFile."sway/config.d/colorscheme.conf".source = ./config/config.d/colorscheme.conf;
|
|
|
|
xdg.configFile."sway/config.d/theme.conf".source = ./config/config.d/theme.conf;
|
|
|
|
xdg.configFile."sway/config.d/gaps.conf".source = ./config/config.d/gaps.conf;
|
|
|
|
xdg.configFile."sway/config.d/custom-keybindings.conf".source = ./config/config.d/custom-keybindings.conf;
|
|
|
|
xdg.configFile."sway/config.d/mode_system.conf".text =
|
|
|
|
import ./config/config.d/mode_system.conf.nix
|
|
|
|
{ inherit pkgs psCfg; };
|
|
|
|
xdg.configFile."sway/config.d/applications.conf".source = ./config/config.d/applications.conf;
|
|
|
|
xdg.configFile."sway/config.d/systemd.conf".source = ./config/config.d/systemd.conf;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|