diff --git a/NVIDIA-Linux-x86_64-535.288.01-grid.run b/NVIDIA-Linux-x86_64-535.288.01-grid.run old mode 100644 new mode 100755 diff --git a/README.md b/README.md index 98ee12a..4a5bb79 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -sudo nixos-rebuild switch --flake .#mango --impure +sudo nixos-rebuild switch --flake .#mango --impure --show-trace diff --git a/configuration.nix b/configuration.nix index 3e90cac..0208653 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ config, pkgs, inputs, ... }: let nvidia_grid_version = "535.288.01"; @@ -19,10 +19,60 @@ in boot.loader.efi.canTouchEfiVariables = true; boot.kernelPackages = pkgs.linuxPackages_6_12; boot.blacklistedKernelModules = [ "nouveau" ]; + boot.kernelModules = [ "uinput" ]; boot.supportedFilesystems = [ "nfs" ]; services.rpcbind.enable = true; # needed for NFS + services.sunshine = { + enable = true; + autoStart = true; + capSysAdmin = true; # Sunshine이 가상 입력을 제어하기 위해 필요 + openFirewall = true; # Sunshine 포트(47984-48010) 자동 허용 + }; + + # 2. XDG Desktop Portal 설정 (libei의 통로 역할을 합니다) + xdg.portal = { + enable = true; + wlr.enable = true; # Sway(wlroots) 전용 포털 + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + pkgs.libei # libei 패키지 명시적 포함 + ]; + config.common.default = "*"; + }; + + # 3. 환경 변수 추가 (Sway가 libei를 인식하도록 함) + environment.variables = { + "LIBEI_SOCKET" = "1"; + "WLR_LIBSEAT_BACKEND" = "seatd"; + }; + + services.udev.extraRules = '' + KERNEL=="uinput", GROUP="input", MODE="0666", OPTIONS+="static_node=uinput" + ''; + + systemd.user.services.mango = { + description = "mango Headless Session"; + wantedBy = [ "default.target" ]; + serviceConfig = { + # Wayland 헤드리스 백엔드 강제 사용 + Environment = [ + "WLR_BACKENDS=headless" + "WLR_LIBINPUT_NO_DEVICES=1" + "WLR_LIBSEAT_BACKEND=libseat" + "XDG_SESSION_TYPE=wayland" + "XDG_CURRENT_DESKTOP=mango" + ]; + # Sway 실행 (가상 디스플레이 1개 생성) + ExecStart = "dbus-run-session mango"; + Restart = "always"; + }; +}; + + # 유저 세션이 로그아웃 되어도 서비스가 유지되도록 설정 + users.users.bangae1.linger = true; + systemd.mounts = [{ type = "nfs"; mountConfig = { @@ -111,7 +161,7 @@ in users.users.bangae1 = { isNormalUser = true; description = "bangae1"; - extraGroups = [ "networkmanager" "wheel" "input" "video" ]; + extraGroups = [ "networkmanager" "wheel" "input" "video" "seat" ]; packages = with pkgs; []; }; diff --git a/hm/mango/config/execs.conf b/hm/mango/config/execs.conf index 7ed5776..7ec30ce 100644 --- a/hm/mango/config/execs.conf +++ b/hm/mango/config/execs.conf @@ -1,3 +1,4 @@ # Auto start exec-once = noctalia-shell +exec-once = sunshine exec = kime