make vr work yippie

This commit is contained in:
Kopatz
2025-08-12 21:46:19 +02:00
parent 4973f7c5f8
commit 9a75f0b57b
6 changed files with 181 additions and 54 deletions

112
flake.lock generated
View File

@@ -150,6 +150,20 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat": {
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"revCount": 69,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.1.0/01948eb7-9cba-704f-bbf3-3fa956735b52/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@@ -249,6 +263,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_3": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"fromYaml": { "fromYaml": {
"flake": false, "flake": false,
"locked": { "locked": {
@@ -416,6 +448,43 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-xr": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1754962187,
"narHash": "sha256-KnYuOGLgvpmFrd32Xs3NIvVHgVI7BS8xbw5z04ojDyI=",
"owner": "nix-community",
"repo": "nixpkgs-xr",
"rev": "a3ac1310d4c1f728d5cf53e75ea829ccf7ef11b9",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs-xr",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1754725699,
"narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "85dbfc7aaf52ecb755f87e577ddbe6dbbdbc1054",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixvim": { "nixvim": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
@@ -423,7 +492,7 @@
"nixpkgs-unstable" "nixpkgs-unstable"
], ],
"nuschtosSearch": "nuschtosSearch", "nuschtosSearch": "nuschtosSearch",
"systems": "systems_4" "systems": "systems_5"
}, },
"locked": { "locked": {
"lastModified": 1754682350, "lastModified": 1754682350,
@@ -487,7 +556,7 @@
}, },
"nuschtosSearch": { "nuschtosSearch": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_3",
"ixx": "ixx", "ixx": "ixx",
"nixpkgs": [ "nixpkgs": [
"nixvim", "nixvim",
@@ -519,6 +588,7 @@
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"nixpkgs-working-xrdp": "nixpkgs-working-xrdp", "nixpkgs-working-xrdp": "nixpkgs-working-xrdp",
"nixpkgs-xr": "nixpkgs-xr",
"nixvim": "nixvim", "nixvim": "nixvim",
"nur": "nur", "nur": "nur",
"stylix": "stylix" "stylix": "stylix"
@@ -537,7 +607,7 @@
"nixpkgs-unstable" "nixpkgs-unstable"
], ],
"nur": "nur_2", "nur": "nur_2",
"systems": "systems_5", "systems": "systems_6",
"tinted-foot": "tinted-foot", "tinted-foot": "tinted-foot",
"tinted-kitty": "tinted-kitty", "tinted-kitty": "tinted-kitty",
"tinted-schemes": "tinted-schemes", "tinted-schemes": "tinted-schemes",
@@ -633,6 +703,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_6": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tinted-foot": { "tinted-foot": {
"flake": false, "flake": false,
"locked": { "locked": {
@@ -713,6 +798,27 @@
"repo": "base16-zed", "repo": "base16-zed",
"type": "github" "type": "github"
} }
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs-xr",
"nixpkgs"
]
},
"locked": {
"lastModified": 1754847726,
"narHash": "sha256-2vX8QjO5lRsDbNYvN9hVHXLU6oMl+V/PsmIiJREG4rE=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "7d81f6fb2e19bf84f1c65135d1060d829fae2408",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@@ -22,6 +22,7 @@
}; };
## unstable ## unstable
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-xr.url = "github:nix-community/nixpkgs-xr";
home-manager-unstable = { home-manager-unstable = {
url = "github:nix-community/home-manager/master"; url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs-unstable"; inputs.nixpkgs.follows = "nixpkgs-unstable";
@@ -104,6 +105,7 @@
[ specialArgs.home-manager-version.nixosModules.home-manager ] [ specialArgs.home-manager-version.nixosModules.home-manager ]
++ lib.lists.optionals (!minimal && graphical) [ ++ lib.lists.optionals (!minimal && graphical) [
stylix.nixosModules.stylix stylix.nixosModules.stylix
inputs.nixpkgs-xr.nixosModules.nixpkgs-xr
./modules/graphical/stylix.nix ./modules/graphical/stylix.nix
#nixos-cosmic.nixosModules.default #nixos-cosmic.nixosModules.default
#./modules/graphical/cosmic.nix #./modules/graphical/cosmic.nix

View File

@@ -1,22 +1,26 @@
{ pkgs, config, ... }: { pkgs, config, osConfig, lib, ... }:
{ {
#xdg.configFile."openvr/openvrpaths.vrpath".text = '' config = lib.mkIf osConfig.custom.hardware.vr.enable
# { {
# "config" : xdg.configFile."openxr/1/active_runtime.json".source = "${pkgs.monado}/share/openxr/1/openxr_monado.json";
# [ xdg.configFile."openvr/openvrpaths.vrpath".text = ''
# "~/.local/share/Steam/config" {
# ], "config" :
# "external_drivers" : null, [
# "jsonid" : "vrpathreg", "~/.local/share/Steam/config"
# "log" : ],
# [ "external_drivers" : null,
# "~/.local/share/Steam/logs" "jsonid" : "vrpathreg",
# ], "log" :
# "runtime" : [
# [ "~/.local/share/Steam/logs"
# "${pkgs.opencomposite}/lib/opencomposite" ],
# ], "runtime" :
# "version" : 1 [
# } "${pkgs.opencomposite}/lib/opencomposite"
#''; ],
"version" : 1
}
'';
};
} }

View File

@@ -11,5 +11,6 @@
./tpm.nix ./tpm.nix
./tablet.nix ./tablet.nix
./fingerprint.nix ./fingerprint.nix
./vr.nix
]; ];
} }

View File

@@ -1,5 +1,6 @@
{ pkgs, config, ... }: { pkgs, config, lib, ... }:
let let
cfg = config.custom.hardware.vr;
# https://wiki.nixos.org/wiki/VR#Patching_AMDGPU_to_allow_high_priority_queues # https://wiki.nixos.org/wiki/VR#Patching_AMDGPU_to_allow_high_priority_queues
amdgpu = amdgpu =
{ pkgs { pkgs
@@ -46,27 +47,39 @@ let
}; };
in in
{ {
options.custom.hardware.vr = {
enable = lib.mkEnableOption "Enables amd gpus";
overdrive = lib.mkEnableOption "Enables overdrive";
rocm.enable = lib.mkEnableOption "Enables rocm";
};
#programs.envision = { #programs.envision = {
# enable = true; # enable = true;
# openFirewall = true; # openFirewall = true;
#}; #};
# systemctl --user start monado.service # systemctl --user start monado.service
#services.monado = { # make sure ~/.config/openxr/1/active_runtime.json doesn't block it
# enable = true; # and ~/.config/openvr/openvrpaths.vrpath
# defaultRuntime = true; # Register as default OpenXR runtime config = lib.mkIf cfg.enable {
#}; services.monado = {
#environment.systemPackages = with pkgs; [ enable = true;
# monado defaultRuntime = true; # Register as default OpenXR runtime
#]; };
#systemd.user.services.monado.environment = { environment.systemPackages = with pkgs; [
# STEAMVR_LH_ENABLE = "1"; monado
# XRT_COMPOSITOR_COMPUTE = "1"; wlx-overlay-s
# WMR_HANDTRACKING = "0"; wayvr-dashboard
#}; ];
#programs.git = { systemd.user.services.monado.environment = {
# enable = true; STEAMVR_LH_ENABLE = "1";
# lfs.enable = true; XRT_COMPOSITOR_COMPUTE = "1";
#}; WMR_HANDTRACKING = "0";
};
programs.git = {
enable = true;
lfs.enable = true;
};
hardware.steam-hardware.enable = true; hardware.steam-hardware.enable = true;
boot.extraModulePackages = [ boot.extraModulePackages = [
@@ -80,4 +93,5 @@ in
]; ];
})) }))
]; ];
};
} }

View File

@@ -18,7 +18,6 @@
../../modules/misc/faster-boot-time.nix ../../modules/misc/faster-boot-time.nix
#../../modules/hardware/ryzenmonitor.nix #../../modules/hardware/ryzenmonitor.nix
../../modules/networkmanager.nix ../../modules/networkmanager.nix
../../modules/hardware/vr.nix
]; ];
custom = { custom = {
@@ -50,6 +49,7 @@
rocm.enable = true; rocm.enable = true;
overdrive = true; overdrive = true;
}; };
vr.enable = true;
nvidia = { nvidia = {
enable = false; enable = false;
clock = { clock = {