sway: lift waybar to own file and sandbox it

This commit is contained in:
2024-02-15 02:33:32 +00:00
parent fde1e5d872
commit 10feb319fe
4 changed files with 27 additions and 4 deletions

View File

@@ -86,6 +86,7 @@
./tor-browser.nix
./tuba.nix
./vlc.nix
./waybar.nix
./waylock.nix
./wike.nix
./wine.nix

View File

@@ -0,0 +1,25 @@
{ config, ... }:
let
cfg = config.sane.programs.waybar;
in
{
sane.programs.waybar = {
sandbox.method = "bwrap";
sandbox.wrapperType = "wrappedDerivation";
sandbox.net = "all"; #< to show net connection status and BW
sandbox.whitelistDbus = [ "user" ];
sandbox.whitelistWayland = true;
sandbox.extraRuntimePaths = [ "/" ]; #< needs to talk to sway IPC. TODO: give the sway IPC a predictable name.
sandbox.extraHomePaths = [ ".config/waybar" ]; #< TODO: migrate config files to this file and then safe to remove
services.waybar = {
description = "sway header bar";
wantedBy = [ "graphical-session.target" ];
serviceConfig.ExecStart = "${cfg.package}/bin/waybar";
serviceConfig.Type = "simple";
serviceConfig.Restart = "on-failure";
serviceConfig.RestartSec = "10s";
# environment.G_MESSAGES_DEBUG = "all";
};
};
}

View File

@@ -121,6 +121,7 @@ in
description = "command to run when user wants to take a screenshot";
};
};
# TODO: move to hosts/common/programs/waybar.nix
sane.gui.sway.waybar.extra_style = mkOption {
type = types.lines;
default = ''

View File

@@ -141,10 +141,6 @@ mode "resize" {
bindsym l resize grow width 30 px
}
bar {
swaybar_command waybar
}
### application-specific settings
#### to obtain app-id's run `swaymsg -t get_tree`
for_window [app_id="pinentry-.*"] floating true