tahani: add headless niri workstation with Sunshine streaming
This commit is contained in:
@@ -14,7 +14,9 @@
|
|||||||
../../profiles/core.nix
|
../../profiles/core.nix
|
||||||
../../profiles/nixos.nix
|
../../profiles/nixos.nix
|
||||||
../../profiles/openssh.nix
|
../../profiles/openssh.nix
|
||||||
|
../../profiles/remote-desktop.nix
|
||||||
../../profiles/tailscale.nix
|
../../profiles/tailscale.nix
|
||||||
|
../../profiles/wayland-headless.nix
|
||||||
inputs.sops-nix.nixosModules.sops
|
inputs.sops-nix.nixosModules.sops
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -30,12 +32,14 @@
|
|||||||
../../profiles/fish.nix
|
../../profiles/fish.nix
|
||||||
../../profiles/fzf.nix
|
../../profiles/fzf.nix
|
||||||
../../profiles/git.nix
|
../../profiles/git.nix
|
||||||
|
../../profiles/ghostty.nix
|
||||||
../../profiles/home.nix
|
../../profiles/home.nix
|
||||||
../../profiles/jjui.nix
|
../../profiles/jjui.nix
|
||||||
../../profiles/jujutsu.nix
|
../../profiles/jujutsu.nix
|
||||||
../../profiles/lazygit.nix
|
../../profiles/lazygit.nix
|
||||||
../../profiles/lumen.nix
|
../../profiles/lumen.nix
|
||||||
../../profiles/mise.nix
|
../../profiles/mise.nix
|
||||||
|
../../profiles/niri.nix
|
||||||
../../profiles/nono.nix
|
../../profiles/nono.nix
|
||||||
../../profiles/neovim
|
../../profiles/neovim
|
||||||
../../profiles/opencode.nix
|
../../profiles/opencode.nix
|
||||||
|
|||||||
@@ -36,44 +36,44 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
on-window-detected = [
|
on-window-detected = [
|
||||||
{
|
{
|
||||||
"if" = {
|
"if" = {
|
||||||
"app-id" = "com.apple.systempreferences";
|
"app-id" = "com.apple.systempreferences";
|
||||||
};
|
};
|
||||||
run = "layout floating";
|
run = "layout floating";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
"if" = {
|
"if" = {
|
||||||
"app-id" = "com.mitchellh.ghostty";
|
"app-id" = "com.mitchellh.ghostty";
|
||||||
};
|
};
|
||||||
run = ["layout tiling" "move-node-to-workspace 3"];
|
run = ["layout tiling" "move-node-to-workspace 3"];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
"if" = {
|
"if" = {
|
||||||
"app-id" = "net.imput.helium";
|
"app-id" = "net.imput.helium";
|
||||||
};
|
};
|
||||||
run = "move-node-to-workspace 2";
|
run = "move-node-to-workspace 2";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
"if" = {
|
"if" = {
|
||||||
"app-id" = "com.tinyspeck.slackmacgap";
|
"app-id" = "com.tinyspeck.slackmacgap";
|
||||||
};
|
};
|
||||||
run = "move-node-to-workspace 5";
|
run = "move-node-to-workspace 5";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
"if" = {
|
"if" = {
|
||||||
"app-id" = "net.whatsapp.WhatsApp";
|
"app-id" = "net.whatsapp.WhatsApp";
|
||||||
};
|
};
|
||||||
run = "move-node-to-workspace 5";
|
run = "move-node-to-workspace 5";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
"if" = {
|
"if" = {
|
||||||
"app-id" = "com.tidal.desktop";
|
"app-id" = "com.tidal.desktop";
|
||||||
};
|
};
|
||||||
run = "move-node-to-workspace 6";
|
run = "move-node-to-workspace 6";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
mode = {
|
mode = {
|
||||||
main.binding = {
|
main.binding = {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
casks = [
|
casks = [
|
||||||
"ghostty@tip"
|
"ghostty@tip"
|
||||||
"helium-browser"
|
"helium-browser"
|
||||||
|
"moonlight"
|
||||||
"tidal"
|
"tidal"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|||||||
18
profiles/niri.nix
Normal file
18
profiles/niri.nix
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{...}: {
|
||||||
|
xdg.configFile."niri/config.kdl".text = ''
|
||||||
|
input {
|
||||||
|
keyboard {
|
||||||
|
xkb {
|
||||||
|
layout "us"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
binds {
|
||||||
|
Mod+Return { spawn "ghostty"; }
|
||||||
|
Mod+B { spawn "firefox"; }
|
||||||
|
Mod+Shift+Q { close-window; }
|
||||||
|
Mod+Shift+E { quit; }
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -61,6 +61,8 @@ with pkgs;
|
|||||||
]
|
]
|
||||||
++ lib.optionals stdenv.isLinux [
|
++ lib.optionals stdenv.isLinux [
|
||||||
gcc15
|
gcc15
|
||||||
|
ghostty
|
||||||
ghostty.terminfo
|
ghostty.terminfo
|
||||||
|
google-chrome
|
||||||
lm_sensors
|
lm_sensors
|
||||||
]
|
]
|
||||||
|
|||||||
21
profiles/remote-desktop.nix
Normal file
21
profiles/remote-desktop.nix
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{...}: {
|
||||||
|
services.sunshine = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = false;
|
||||||
|
capSysAdmin = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.interfaces.tailscale0 = {
|
||||||
|
allowedTCPPorts = [
|
||||||
|
47984
|
||||||
|
47989
|
||||||
|
47990
|
||||||
|
];
|
||||||
|
allowedUDPPorts = [
|
||||||
|
47998
|
||||||
|
47999
|
||||||
|
48000
|
||||||
|
48002
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
39
profiles/wayland-headless.nix
Normal file
39
profiles/wayland-headless.nix
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
user,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
services.seatd.enable = true;
|
||||||
|
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
wireplumber.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.portal = {
|
||||||
|
enable = true;
|
||||||
|
extraPortals = with pkgs; [
|
||||||
|
xdg-desktop-portal-wlr
|
||||||
|
xdg-desktop-portal-gtk
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.niri.enable = true;
|
||||||
|
|
||||||
|
users.users.${user}.linger = true;
|
||||||
|
|
||||||
|
systemd.user.services.niri-headless = {
|
||||||
|
description = "Niri headless session";
|
||||||
|
environment = {
|
||||||
|
WLR_BACKENDS = "headless";
|
||||||
|
WLR_HEADLESS_OUTPUTS = "1";
|
||||||
|
WAYLAND_DISPLAY = "wayland-1";
|
||||||
|
};
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${pkgs.niri}/bin/niri --session";
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = 2;
|
||||||
|
};
|
||||||
|
wantedBy = ["default.target"];
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user