diff --git a/hosts/vulpes/core/boot.nix b/hosts/vulpes/core/boot.nix index 0ebe46b..7f1199d 100644 --- a/hosts/vulpes/core/boot.nix +++ b/hosts/vulpes/core/boot.nix @@ -24,7 +24,7 @@ }; kernelModules = [ "kvm-amd" ]; supportedFilesystems = [ "nfs" ]; - + kernelParams = [ "amdgpu.runpm=0" ]; kernel.sysctl = { "net.ipv4.ip_forward" = 1; }; diff --git a/hosts/vulpes/core/hardware.nix b/hosts/vulpes/core/hardware.nix index 6ac875f..4b02101 100644 --- a/hosts/vulpes/core/hardware.nix +++ b/hosts/vulpes/core/hardware.nix @@ -1,7 +1,13 @@ { + pkgs, + modulesPath, ... }: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + fileSystems = { "/" = { device = "/dev/mapper/vulpes-root"; @@ -42,6 +48,10 @@ graphics = { enable = true; enable32Bit = true; + extraPackages = with pkgs; [ + libva-utils + libvdpau-va-gl + ]; }; cpu = { @@ -49,5 +59,7 @@ updateMicrocode = true; }; }; + + uinput.enable = true; }; } diff --git a/hosts/vulpes/core/services.nix b/hosts/vulpes/core/services.nix index a77780f..e8ec082 100644 --- a/hosts/vulpes/core/services.nix +++ b/hosts/vulpes/core/services.nix @@ -1,4 +1,8 @@ -{ args, config, ... }: +{ + args, + config, + ... +}: let pm = (args.mods.priv_mod.get_data args); in @@ -33,17 +37,28 @@ in qemuGuest = { enable = true; }; + + pipewire = { + enable = true; + pulse.enable = true; + wireplumber = { + enable = true; + }; + }; }; - systemd.services.netbird-vulpes = { - serviceConfig = { - AmbientCapabilities = [ - "CAP_NET_BIND_SERVICE" - "CAP_DAC_OVERRIDE" - ]; - ReadWritePaths = [ - "/etc/resolv.conf" - "/etc/resolv.conf.original.netbird" - ]; + systemd.services = { + netbird-vulpes = { + serviceConfig = { + AmbientCapabilities = [ + "CAP_NET_BIND_SERVICE" + "CAP_DAC_OVERRIDE" + ]; + ReadWritePaths = [ + "/etc/resolv.conf" + "/etc/resolv.conf.original.netbird" + ]; + }; }; }; + } diff --git a/hosts/vulpes/core/users.nix b/hosts/vulpes/core/users.nix index 50c750c..c8909eb 100644 --- a/hosts/vulpes/core/users.nix +++ b/hosts/vulpes/core/users.nix @@ -28,6 +28,17 @@ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIkUMYuTCjDCIldnrQlA8M5gPkEUZ/oXxD5+B7nNeoM3 openpgp:0x13D59319" ]; }; + sunshine = { + group = "sunshine"; + isNormalUser = true; + extraGroups = [ + "uinput" + "input" + "video" + "render" + "audio" + ]; + }; ente = { uid = 5000; group = "ente"; @@ -58,6 +69,10 @@ name = "zerda"; members = [ "zerda" ]; }; + sunshine = { + name = "sunshine"; + members = [ "sunshine" ]; + }; }; }; } diff --git a/hosts/vulpes/default.nix b/hosts/vulpes/default.nix index e6bf220..5e59d1b 100644 --- a/hosts/vulpes/default.nix +++ b/hosts/vulpes/default.nix @@ -1,7 +1,6 @@ { args, pkgs, - lib, ... }: let @@ -9,7 +8,6 @@ let in { imports = [ - (args.sources.nixpkgs.outPath + "/nixos/modules/profiles/minimal.nix") args.pins.nix-minecraft.nixosModules.minecraft-servers args.pins.sops-nix.nixosModules.sops ] @@ -25,6 +23,7 @@ in zellij configarr vulkan-tools + mangohud ]; nix.settings = { diff --git a/hosts/vulpes/infra/gaming.nix b/hosts/vulpes/infra/gaming.nix new file mode 100644 index 0000000..b7b9954 --- /dev/null +++ b/hosts/vulpes/infra/gaming.nix @@ -0,0 +1,92 @@ +{ pkgs, ... }: +let + sway_startup_command = pkgs.writeShellScript "start_sway.sh" '' + export XDG_CURRENT_DESKTOP=sway + export XDG_SESSION_DESKTOP=sway + export XDG_SESSION_TYPE=wayland + export XDG_RUNTIME_DIR=/run/user/1001 + + export WLR_BACKENDS=headless,libinput + export WAYLAND_DISPLAY=wayland-1 + + ${pkgs.sway}/bin/sway --config /etc/sway_config + ''; + + sunshine_apps = { + apps = [ + { + name = "Desktop"; + } + { + name = "Endfield"; + cmd = "${endfield_script}"; + } + ]; + env = { }; + }; + + sunshine_conf = pkgs.writeText "sunshine.conf" '' + file_apps=${pkgs.writeText "sunshine_apps.json" (builtins.toJSON sunshine_apps)} + port=47989 + audio_sink=sink-sunshine-stereo + ''; + + endfield_script = pkgs.writeShellScript "run_endfield.sh" '' + # export MANGOHUD=1 + export PROTONPATH="/home/sunshine/Games/components/proton/dwproton-10.0-14-x86_64" + export WINEPREFIX="/home/sunshine/Games/prefixes/Endfield" + export RUNTIMEPATH="/home/sunshine/Games/components/steam_runtime/3.0.20251216.191774" + ${pkgs.umu-launcher}/bin/umu-run /home/sunshine/Games/Endfield/Endfield.exe + env >> /home/sunshine/log.txt + ''; +in +{ + environment.etc."sway_config" = { + text = '' + output HEADLESS-1 { + pos 0,0 + mode 2560x1600@120Hz + } + default_border none + + set $mod Mod1 + bindsym $mod+Q exec ${pkgs.foot}/bin/foot + + bindsym $mod+1 workspace 1 + bindsym $mod+2 workspace 2 + bindsym $mod+3 workspace 3 + bindsym $mod+4 workspace 4 + bindsym $mod+5 workspace 5 + + bindsym $mod+Shift+C kill + bindsym $mod+F fullscreen + bindsym $mod+R reload + + exec systemctl --user import-environment WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE + exec_always ${pkgs.sunshine}/bin/sunshine ${sunshine_conf} + ''; + }; + + services = { + udev.extraRules = '' + KERNEL=="uinput", SUBSYSTEM=="misc", OPTIONS+="static_node=uinput", GROUP="input", MODE="0660" + ''; + + greetd = { + enable = true; + settings = rec { + terminal = { + vt = 1; + }; + initial_session = { + command = "${sway_startup_command}"; + user = "sunshine"; + }; + default_session = initial_session; + }; + }; + }; + systemd.services.greetd = { + wantedBy = [ "multi-user.target" ]; + }; +} diff --git a/hosts/vulpes/infra/minecraft.nix b/hosts/vulpes/infra/minecraft.nix index cf792d1..cec4c7f 100644 --- a/hosts/vulpes/infra/minecraft.nix +++ b/hosts/vulpes/infra/minecraft.nix @@ -80,7 +80,7 @@ in }; servers = { atr10 = { - enable = true; + enable = false; autoStart = true; serverProperties = { server-port = 2755; diff --git a/hosts/work/core/hardware.nix b/hosts/work/core/hardware.nix index e71c15e..873ccbd 100644 --- a/hosts/work/core/hardware.nix +++ b/hosts/work/core/hardware.nix @@ -1,6 +1,4 @@ { - config, - lib, pkgs, modulesPath, ... diff --git a/hosts/work/core/packages.nix b/hosts/work/core/packages.nix index 15894db..f85c8d0 100644 --- a/hosts/work/core/packages.nix +++ b/hosts/work/core/packages.nix @@ -84,7 +84,7 @@ in token = pm.factorio.token; }) mangohud - elysia + moonlight-qt # Programming rustc diff --git a/hosts/work/core/virtualization.nix b/hosts/work/core/virtualization.nix index 0ba3726..3b30e97 100644 --- a/hosts/work/core/virtualization.nix +++ b/hosts/work/core/virtualization.nix @@ -40,12 +40,24 @@ enable = true; }; - docker = { - rootless = { + podman = { + enable = true; + autoPrune = { + enable = true; + dates = "daily"; + }; + dockerCompat = true; + dockerSocket = { enable = true; - setSocketVariable = true; }; }; + + # docker = { + # rootless = { + # enable = true; + # setSocketVariable = true; + # }; + # }; }; security.wrappers = { diff --git a/modules/priv b/modules/priv index cbe6817..60d8aac 160000 --- a/modules/priv +++ b/modules/priv @@ -1 +1 @@ -Subproject commit cbe68174239ca6f260d615211a967d96363252ce +Subproject commit 60d8aac90beb15e4814821f5629b0257fcdbac8a diff --git a/npins/sources.json b/npins/sources.json index bf263f7..6ac2c63 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -48,9 +48,9 @@ }, "branch": "main", "submodules": false, - "revision": "8539013044624a257e8da370069107aea148e985", - "url": "https://github.com/feel-co/hjem/archive/8539013044624a257e8da370069107aea148e985.tar.gz", - "hash": "sha256-I2zxtEafZbFbqXe71rjqwVeTDv8SIVLaSzQd39SwfwM=" + "revision": "9d0c8d4b44f661910595b07e6480557644c1431c", + "url": "https://github.com/feel-co/hjem/archive/9d0c8d4b44f661910595b07e6480557644c1431c.tar.gz", + "hash": "sha256-cKETEBrseo7Iz+bOzflwy1xTpDuUj3QaLA+P49yJw8k=" }, "hjem-rum": { "type": "Git", @@ -111,9 +111,9 @@ }, "branch": "nixos-unstable", "submodules": false, - "revision": "1412caf7bf9e660f2f962917c14b1ea1c3bc695e", - "url": "https://github.com/NixOS/nixpkgs/archive/1412caf7bf9e660f2f962917c14b1ea1c3bc695e.tar.gz", - "hash": "sha256-AIdl6WAn9aymeaH/NvBj0H9qM+XuAuYbGMZaP0zcXAQ=" + "revision": "c5296fdd05cfa2c187990dd909864da9658df755", + "url": "https://github.com/NixOS/nixpkgs/archive/c5296fdd05cfa2c187990dd909864da9658df755.tar.gz", + "hash": "sha256-oMmN1lVQU0F0W2k6OI3bgdzp2YOHWYUAw79qzDSjenU=" }, "nixpkgs-jelly": { "type": "Git", @@ -138,9 +138,9 @@ }, "branch": "master", "submodules": false, - "revision": "cd5629ba0f8e35e70024c96b70ce5a261c7a2211", - "url": "https://github.com/NixOS/nixpkgs/archive/cd5629ba0f8e35e70024c96b70ce5a261c7a2211.tar.gz", - "hash": "sha256-OqNTHtPlfLOo/CE9np7RktpY9GdN/c4s8Zuuuhzo1CM=" + "revision": "892a4046a680000914ffeb3121ae9104bd5b3f93", + "url": "https://github.com/NixOS/nixpkgs/archive/892a4046a680000914ffeb3121ae9104bd5b3f93.tar.gz", + "hash": "sha256-W/sVQL3ZE9JajudQR2b/nfv4XhzlBZB9DHcr/8NjC9c=" }, "sops-nix": { "type": "Git", @@ -151,9 +151,9 @@ }, "branch": "master", "submodules": false, - "revision": "e085e303dfcce21adcb5fec535d65aacb066f101", - "url": "https://github.com/Mic92/sops-nix/archive/e085e303dfcce21adcb5fec535d65aacb066f101.tar.gz", - "hash": "sha256-NjKtkJraCZEnLHAJxLTI+BfdU//9coAz9p5TqveZwPU=" + "revision": "2eb9eed7ef48908e0f02985919f7eb9d33fa758f", + "url": "https://github.com/Mic92/sops-nix/archive/2eb9eed7ef48908e0f02985919f7eb9d33fa758f.tar.gz", + "hash": "sha256-+Uvq9h2eGsbhacXpuS7irYO7fFlz514nrhPCSTkASlw=" }, "stash": { "type": "Git",