b12f restructure #1

Merged
teutat3s merged 218 commits from b12f into main 2020-11-24 18:27:01 +00:00
4 changed files with 43 additions and 5 deletions
Showing only changes of commit ad313173ad - Show all commits

View file

@ -47,3 +47,9 @@ mode "$mode_system" {
bindsym Return mode "default" bindsym Return mode "default"
bindsym Escape mode "default" bindsym Escape mode "default"
} }
set $mode_vncclient In VNCClient mode. Press $mod+Num_Lock to return.
bindsym $mod+Num_Lock mode "$mode_vncclient"
mode "$mode_vncclient" {
bindsym $mod+Num_Lock mode "default"
}

View file

@ -0,0 +1,8 @@
{ psCfg, pkgs }: "
address=0.0.0.0
enable_auth=true
username=${psCfg.user.name}
password=${psCfg.user.password}
private_key_file=/run/secrets/vnc-key.pem
certificate_file=/run/secrets/vnc-cert.pem
"

View file

@ -7,11 +7,13 @@ in
{ {
options.pub-solar.sway = { options.pub-solar.sway = {
enable = mkEnableOption "Life in boxes"; enable = mkEnableOption "Life in boxes";
}; vnc.enable = mkEnableOption "Enable vnc service";
options.pub-solar.sway.v4l2loopback.enable = mkOption {
type = types.bool; v4l2loopback.enable = mkOption {
default = true; type = types.bool;
description = "WebCam streaming tool"; default = true;
description = "WebCam streaming tool";
};
}; };
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [
@ -76,6 +78,8 @@ in
systemd.user.services.waybar = import ./waybar.service.nix pkgs; systemd.user.services.waybar = import ./waybar.service.nix pkgs;
systemd.user.targets.sway-session = import ./sway-session.target.nix pkgs; systemd.user.targets.sway-session = import ./sway-session.target.nix pkgs;
systemd.user.services.wayvnc = mkIf cfg.vnc.enable (import ./wayvnc.service.nix pkgs);
xdg.configFile."sway/config".source = ./config/config; xdg.configFile."sway/config".source = ./config/config;
xdg.configFile."sway/config.d/colorscheme.conf".source = ./config/config.d/colorscheme.conf; 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/theme.conf".source = ./config/config.d/theme.conf;
@ -83,6 +87,7 @@ in
xdg.configFile."sway/config.d/custom-keybindings.conf".source = ./config/config.d/custom-keybindings.conf; xdg.configFile."sway/config.d/custom-keybindings.conf".source = ./config/config.d/custom-keybindings.conf;
xdg.configFile."sway/config.d/applications.conf".source = ./config/config.d/applications.conf; 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; xdg.configFile."sway/config.d/systemd.conf".source = ./config/config.d/systemd.conf;
xdg.configFile."wayvnc/config".text = import ./config/wayvnc/config.nix { inherit psCfg; inherit pkgs; };
}; };
}) })
]); ]);

View file

@ -0,0 +1,19 @@
pkgs:
{
Unit = {
Description = "A VNC server for wlroots based Wayland compositors ";
Documentation = "https://github.com/any1/wayvnc";
BindsTo = [ "sway-session.target" ];
After = [ "graphical-session-pre.target" "network-online.target" ];
Wants = [ "graphical-session-pre.target" "network-online.target" ];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.wayvnc}/bin/wayvnc";
};
Install = {
WantedBy = [ "sway-session.target" ];
};
}