feat(headless): add headless module
This commit is contained in:
parent
f297ae1611
commit
376934f9f2
2 changed files with 75 additions and 0 deletions
24
home/headless/home.nix
Normal file
24
home/headless/home.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{ pkgs
|
||||
, lib
|
||||
, config
|
||||
, ... }: with lib; let
|
||||
cfg = config.passthrough.headless;
|
||||
in mkIf (cfg.enable != null) {
|
||||
wayland.windowManager.sway.config = {
|
||||
output = {
|
||||
${cfg.enable}.pos = "0 0";
|
||||
HEADLESS-1 = cfg.output;
|
||||
};
|
||||
|
||||
startup = [ { command = "swaymsg create_output && swaymsg output HEADLESS-1 disable"; } ];
|
||||
};
|
||||
|
||||
home.packages = [ (pkgs.writeShellScriptBin "headless" ''
|
||||
swaymsg output HEADLESS-1 enable
|
||||
${pkgs.wayvnc}/bin/wayvnc \
|
||||
--output=HEADLESS-1 \
|
||||
${cfg.extraArgs} \
|
||||
${cfg.host} ${toString cfg.port}
|
||||
swaymsg output HEADLESS-1 disable
|
||||
'') ];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue