2021-05-30 19:10:28 +00:00
|
|
|
{
|
2022-11-20 22:28:23 +00:00
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2021-05-30 19:10:28 +00:00
|
|
|
with lib; let
|
|
|
|
psCfg = config.pub-solar;
|
2022-11-20 22:28:23 +00:00
|
|
|
in {
|
2021-05-30 19:10:28 +00:00
|
|
|
options.pub-solar.sway = {
|
|
|
|
enable = mkEnableOption "Life in boxes";
|
2022-08-14 15:10:30 +00:00
|
|
|
|
|
|
|
terminal = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = "alacritty";
|
|
|
|
description = "Choose sway's default terminal";
|
|
|
|
};
|
|
|
|
|
|
|
|
v4l2loopback.enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
description = "WebCam streaming tool";
|
|
|
|
};
|
2021-05-30 19:10:28 +00:00
|
|
|
};
|
|
|
|
|
2022-08-14 15:10:30 +00:00
|
|
|
config = mkIf psCfg.sway.enable (mkMerge [
|
|
|
|
(mkIf (psCfg.sway.v4l2loopback.enable) {
|
2021-05-30 19:10:28 +00:00
|
|
|
boot.extraModulePackages = with config.boot.kernelPackages; [v4l2loopback];
|
|
|
|
boot.kernelModules = ["v4l2loopback"];
|
|
|
|
boot.extraModprobeConfig = ''
|
|
|
|
options v4l2loopback exclusive_caps=1 devices=3
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
|
|
|
|
{
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
linuxPackages.v4l2loopback
|
|
|
|
];
|
|
|
|
|
|
|
|
programs.sway.enable = true;
|
|
|
|
|
|
|
|
xdg.portal = {
|
|
|
|
enable = true;
|
2022-01-19 00:13:15 +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];
|
2021-05-30 19:10:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
services.pipewire.enable = true;
|
|
|
|
|
|
|
|
home-manager = with pkgs;
|
|
|
|
pkgs.lib.setAttrByPath ["users" psCfg.user.name] {
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
sway
|
|
|
|
grim
|
|
|
|
kanshi
|
|
|
|
mako
|
|
|
|
slurp
|
|
|
|
swayidle
|
|
|
|
swaylock
|
|
|
|
swaybg
|
|
|
|
xwayland
|
|
|
|
|
|
|
|
libappindicator-gtk3
|
|
|
|
|
|
|
|
wl-clipboard
|
|
|
|
wf-recorder
|
|
|
|
brightnessctl
|
|
|
|
gammastep
|
|
|
|
geoclue2
|
|
|
|
xsettingsd
|
|
|
|
ydotool
|
|
|
|
|
|
|
|
sway-launcher
|
2022-08-14 16:03:32 +00:00
|
|
|
record-screen
|
2021-05-30 19:10:28 +00:00
|
|
|
import-gtk-settings
|
|
|
|
wcwd
|
2023-03-07 15:48:46 +00:00
|
|
|
wdisplays
|
2021-05-30 19:10:28 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
programs.waybar.enable = true;
|
|
|
|
#programs.waybar.systemd.enable = true;
|
|
|
|
|
2022-08-14 15:10:30 +00:00
|
|
|
systemd.user.services.mako = import ./mako.service.nix {inherit pkgs psCfg;};
|
|
|
|
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;};
|
2021-05-30 19:10:28 +00:00
|
|
|
|
2022-02-03 01:01:05 +00:00
|
|
|
xdg.configFile."sway/config".text = import ./config/config.nix {inherit config pkgs;};
|
2021-05-30 19:10:28 +00:00
|
|
|
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;
|
2022-10-01 21:12:48 +00:00
|
|
|
xdg.configFile."sway/config.d/mode_system.conf".text = import ./config/config.d/mode_system.conf.nix {inherit pkgs psCfg;};
|
2021-05-30 19:10:28 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
]);
|
|
|
|
}
|