Skip to content

Commit

Permalink
Organize XDG declartions and VR tweaks
Browse files Browse the repository at this point in the history
- Moved XDG declarations into xdg module
- Add NPM xdg declaration
- Add 50% foevation strength, for better stability with Beat Saber
- Note that NixOS/nixpkgs#350069 is now merged, waiting for it to move
into unstable hydra
  • Loading branch information
NovaViper committed Dec 10, 2024
1 parent 641f495 commit b291909
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
# Nixpkgs PRs
# TODO: https://github.com/NixOS/nixpkgs/pull/216245
nixpkgs-howdy.url = "github:fufexan/nixpkgs/howdy";
# TODO: https://github.com/NixOS/nixpkgs/pull/350069
# TODO: Waiting til https://github.com/NixOS/nixpkgs/pull/350069 is in unstable
nixpkgs-wivrn.url = "github:PassiveLemon/nixpkgs/wivrn-update";
# TODO: BSManager testing
nixpkgs-bsmanager.url = "github:Mistyttm/nixpkgs/add-bs-manager";
Expand Down
3 changes: 3 additions & 0 deletions hosts/ryzennova/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
services.wivrn.config.json = {
# 50 Mb/s, default setting and seems to be the best for Beat Saber
bitrate = 50 * 1000000;
# 0.5x (50%) foveation scaling, don't need it super high because it makes latency higher (which is bad for Beat Saber)
# Lower value means higher foveation
scale = 0.5;
encoders = [
{
encoder = "nvenc";
Expand Down
8 changes: 1 addition & 7 deletions modules/core/home-manager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,7 @@ in

sessionVariables = {
FLAKE = "${hm-config.home.homeDirectory}/Documents/NixConfig";
XDG_BIN_HOME = "${hm-config.home.homeDirectory}/.local/bin";

ANDROID_USER_HOME = "${hm-config.xdg.dataHome}/android";
CUDA_CACHE_PATH = "${hm-config.xdg.cacheHome}/nv";
TLDR_CACHE_DIR = "${hm-config.xdg.cacheHome}/tldr";
};
sessionPath = ["${hm-config.home.sessionVariables.XDG_BIN_HOME}"];
shellAliases.wget = ''wget --hsts-file="${hm-config.xdg.dataHome}/wget-hsts"'';
sessionPath = ["${config.environment.sessionVariables.XDG_BIN_HOME}"];
};
}
18 changes: 17 additions & 1 deletion modules/core/xdg.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
{
config,
lib,
pkgs,
...
}: {
}: let
hm-config = config.hm;
in {
environment.sessionVariables = {
XDG_CACHE_HOME = "$HOME/.cache";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
XDG_BIN_HOME = "$HOME/.local/bin";

ANDROID_USER_HOME = "$XDG_DATA_HOME/android";
CUDA_CACHE_PATH = "$XDG_CACHE_HOME/nv";
TLDR_CACHE_DIR = "$XDG_CACHE_HOME/tldr";
NPM_CONFIG_USERCONFIG = "$XDG_CONFIG_HOME/npm/npmrc";
};

home.shellAliases = {
wget = ''wget --hsts-file="$XDG_DATA_HOME/wget-hsts"'';
};

create.configFile."npm/npmrc".text = ''
prefix=${hm-config.xdg.dataHome}/npm
cache=${hm-config.xdg.cacheHome}/npm
tmp=$XDG_RUNTIME_DIR/npm
init-module=${hm-config.xdg.configHome}/npm/config/npm-init.js
'';
}

0 comments on commit b291909

Please sign in to comment.