This commit is contained in:
Sebastian Moser
2025-06-19 10:32:25 +02:00
parent 618f678235
commit 919673e994
14 changed files with 530 additions and 183 deletions

View File

@@ -1,4 +1,4 @@
{ secretsDir, pkgs, inputs, ... }: let
{ lib, secretsDir, pkgs, inputs, ... }: let
myobs = pkgs.wrapOBS {
plugins = with pkgs.obs-studio-plugins; [
@@ -17,8 +17,9 @@ in {
inputs.home-manager.nixosModules.home-manager
inputs.networkmanager.nixosModules.networkmanager
../users/me/headless.nix
../users/me/gui.nix
../users/root/default.nix
../common/nixos-wayland.nix
];
networking.hostName = "mac";
@@ -39,12 +40,25 @@ in {
8888 # for general usage
9999 # for general usage
6000 # Xserver
6666 # vnc sway
5900 # vnc for win VM
5901 # vnc
5902 # vnc
4400 # rdp win VM
4401 # ssh for mandroid
4402 # random
4403 # random
4404 # random
4405 # clipboard sync
];
networking.firewall.allowedUDPPorts = [
48899 # GoodWe inverter discovery
4410 # lan-mouse
];
swapDevices = [ { device = "/swapfile"; } ];
boot.kernelModules = [ "usbip_core" ];
boot.extraModprobeConfig = "options kvm_intel nested=1";
@@ -72,6 +86,8 @@ in {
};
environment.systemPackages = with pkgs; [
linuxPackages.usbip
helvum
passt
mount
pkgs.hicolor-icon-theme
@@ -121,6 +137,64 @@ in {
'';
};
home-manager.users.me.home.file.".config/sway/config".text = ''
exec ${pkgs.wayvnc}/bin/wayvnc 0.0.0.0 6666
#exec 'wl-paste -w ${pkgs.netcat-openbsd}/bin/nc 192.168.1.11 4405'
#exec 'sh -c "while true; do ${pkgs.netcat-openbsd}/bin/nc -l 4405 | wl-copy; done"'
#exec 'sh -c "while true; do cat ~/clipboard | wl-paste; done"'
'';
home-manager.users.me.programs.lan-mouse = {
enable = true;
systemd = true;
settings = {
authorized_fingerprints."f1:f2:c8:38:fd:e9:34:2f:a0:79:49:b4:ca:d6:4e:c6:31:10:42:1b:9f:ba:61:6f:41:9a:b7:ce:1a:32:47:a1" = "main";
port = 4410;
clients = [
{
position = "left";
hostname = "main";
activate_on_startup = true;
ips = [ "192.168.1.11" ];
port = 4410;
#enter_hook = "${pkgs.wl-clipboard}/bin/wl-paste | ${pkgs.netcat-openbsd}/bin/nc 192.168.1.11 4405";
enter_hook = "/run/current-system/sw/bin/cat /home/me/.cache/clipboard | ${pkgs.netcat-openbsd}/bin/nc 192.168.1.11 4405 -N";
}
];
};
};
home-manager.users.me.systemd.user.services.lan-mouse.Service.Environment = "PATH=/bin";
users.users.me.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGw5kYmBQl8oolNg2VUlptvvSrFSESfeuWpsXRovny0x me@phone"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPgKLRF9iYRH3Y8hPjLX1ZY6GyavruqcQ0Q0Y8bnmpv9 me@tab"
];
#services.greetd.enable = lib.mkForce false;
services.greetd = lib.mkForce {
enable = true;
settings = rec {
terminal.vt = 2;
initial_session = {
command = "${pkgs.writeScriptBin "run-sway" ''
export WLR_RENDERER_ALLOW_SOFTWARE=1
export SDL_VIDEODRIVER=wayland
export _JAVA_AWT_WM_NONREPARENTING=1
export QT_QPA_PLATFORM=wayland
export XDG_CURRENT_DESKTOP=sway
export XDG_SESSION_DESKTOP=sway
exec sway > /tmp/sway-log 2>&1
''}/bin/run-sway";
user = "me";
};
default_session = initial_session;
};
};
systemd.extraConfig = "DefaultLimitNOFILE=2048";
###################################################### the kiosk stuff
boot.plymouth.enable = true;
@@ -184,21 +258,6 @@ in {
networking.networkmanager.enable = true;
networking.networkmanager.profiles = {
home = {
connection = {
id = "home";
uuid = "a02273d9-ad12-395e-8372-f61129635b6f";
type = "ethernet";
autoconnect-priority = "-999";
interface-name = "enp2s0";
};
ipv4 = {
address1 = "192.168.1.33/24,192.168.1.1";
dns = "1.1.1.1;";
method = "manual";
};
};
pw = {
connection = {
id = "pw";
@@ -234,11 +293,15 @@ in {
interface-name = "wlp3s0";
};
wifi = {
mac-address = "0C:96:E6:E3:64:03";
mode = "ap";
ssid = "c2vi-mac";
};
wifi-security = {
key-mgmt = "wpa-psk";
psk = builtins.readFile "${secretsDir}/wifi-password";
};
ipv4 = {
method = "shared";
};
@@ -273,7 +336,7 @@ in {
id = "dhcp";
uuid = "c006389a-1697-4f77-91c3-95b466f85f13";
type = "ethernet";
autoconnect = "false";
autoconnect = true;
interface-name = "enp2s0";
};
@@ -283,6 +346,7 @@ in {
ipv4 = {
method = "auto";
address1 = "192.168.1.33/24,192.168.1.1";
};
};