dotfiles

My PC Dotfiles & Website
commit 1bb1a128d8d10dfdde89dd5d2c4652e8c9f69b28
parent 6712cb1597147eb4b2350866391ce898f421e073
Author: maydayv7 <maydayv7@gmail.com>
Date:   Tue,  6 Jan 2026 02:29:17 +0530

fix: Multiple Fixes

- Fix `flatpak` Configuration
- Fix NVIDIA PRIME
- Refine `apps.games`
  - Add support for Roblox

Diffstat:

MCHANGELOG.md | 6+++++-
Mdevices/valkyrie/default.nix | 5+++--
Mmodules/README.md | 4++--
Mmodules/apps/flatpak.nix | 21+++++++++++++++------
Mmodules/apps/games/default.nix | 26++++++++------------------
Amodules/apps/games/roblox.nix | 18++++++++++++++++++
Mmodules/apps/wine.nix | 4++--
Mmodules/gui/desktop/pantheon/default.nix | 2+-
Mmodules/hardware/gpu.nix | 85++++++++++++++++++++++++++++++++++++++++++++-----------------------------------
Msite/content/blog/nixos/prelude.md | 38+++++++++++++++++++++++++-------------
10 files changed, 126 insertions(+), 83 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -2,7 +2,11 @@ ### January -- Website Changes +- Fix `flatpak` Configuration +- Fix NVIDIA PRIME +- Refine `apps.games` + - Add support for Roblox +- `site` Changes - Start blogging! - Fix comments - `git` frontend using `stagit` diff --git a/devices/valkyrie/default.nix b/devices/valkyrie/default.nix @@ -54,6 +54,7 @@ list = [ "discord" "firefox" + "flatpak" "games" "git" "latex" @@ -61,12 +62,12 @@ "notes" "office" "vscode" - "wine" "youtube" ]; games = [ "minecraft" "osu" + "roblox" ]; }; @@ -81,7 +82,7 @@ }; gui = { - desktop = "niri"; + desktop = "hyprland"; display = "eDP-1"; wallpaper = "Quasar"; fancy = true; diff --git a/modules/README.md b/modules/README.md @@ -17,10 +17,10 @@ Configuration [Builder](./configuration.nix) - `secret`: Path to Secret for `git` Runner - `wine` - - `utilities`: Install Utility Windows apps - `true / false` - - `package`: Package to use for `wine` - Ex. `pkgs.winePackages.staging` + - `package`: Package to use for `wine` - Ex. `pkgs.wineWowPackages.stable` - `logseq.style`: Path to Logseq Notes CSS - `ytmusic.style`: YouTube Music CSS - - `games`: List of installed games - `[ "minecraft" "mc-server" "osu" ]` + - `games`: List of installed games - `[ "minecraft" "mc-server" "osu" "roblox" ]` - `mc-servers`: List of Minecraft Servers - - `name`: Unique server name - `type`: Server Type - `[ "fabric" "skyblock" ]` diff --git a/modules/apps/flatpak.nix b/modules/apps/flatpak.nix @@ -2,10 +2,12 @@ config, lib, inputs, + pkgs, ... }: let enable = builtins.elem "flatpak" config.apps.list; + theme = config.gui.gtk.theme.name; in { ## Flatpak Configuration ## @@ -14,12 +16,15 @@ in config = lib.mkIf enable { warnings = [ '' - Flatpak app install isn't Generational - - Changes in package declaration will result in downloading them anew + Flatpak support is enabled + - App install isn't generational (Changes in configuration will result in downloading them anew) + - Updates must be managed manually '' ]; xdg.portal.enable = true; + system.activationScripts.updateDesktopDatabase.text = "${pkgs.desktop-file-utils}/bin/update-desktop-database /var/lib/flatpak/exports/share/applications"; + environment.persist.directories = [ "/var/lib/flatpak" ]; user.persist.directories = [ ".cache/flatpak" @@ -44,7 +49,7 @@ in ]; # Package List - # Use `flatpak remote-info --log` to find commit revisions + # Use 'flatpak remote-info --log' to find commit revisions packages = [ /* { @@ -58,7 +63,11 @@ in # Platform Integration overrides.global = { Context = { - filesystems = [ "~/.config/dconf:ro" ]; + filesystems = [ + "~/.config/dconf:ro" + "/run/current-system/sw/share/themes:ro" + ]; + sockets = [ "wayland" "!x11" @@ -67,8 +76,8 @@ in }; Environment = { - DCONF_USER_CONFIG_DIR = ".config/dconf"; - XCURSOR_PATH = "/run/host/user-share/icons:/run/host/share/icons"; + "DCONF_USER_CONFIG_DIR" = ".config/dconf"; + "GTK_THEME" = theme; }; }; diff --git a/modules/apps/games/default.nix b/modules/apps/games/default.nix @@ -16,7 +16,6 @@ let inherit (util.map) modules; enable = builtins.elem "games" config.apps.list; wine = builtins.elem "wine" config.apps.list; - wine' = pkgs.gaming.wine-ge; in { imports = modules.list ./.; @@ -29,47 +28,38 @@ in ## Games Configuration ## config = mkIf enable { - assertions = [ - { - assertion = wine; - message = '' - Wine support is required - - Add 'wine to 'apps.list' - ''; - } - ]; - # Packages environment.systemPackages = with pkgs; [ bottles lutris - wine' ]; # Steam programs.steam = { enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; + protontricks.enable = true; localNetworkGameTransfers.openFirewall = true; }; # Game Mode - # See https://github.com/FeralInteractive/gamemode hardware.cpu.mode = mkOverride 51 "performance"; gui.fancy = mkOverride 999 false; - programs.gamemode.enable = true; + programs.gamemode.enable = true; # Use 'gamemoderun %command%' user = { # Runner - homeConfig.xdg.dataFile."lutris/runners/wine/wine-system".source = wine'; + homeConfig.xdg.dataFile."lutris/runners/wine/wine-system" = mkIf wine { + source = config.apps.wine.package; + }; # Directories persist.directories = [ "Games" + ".local/share/bottles" + + # Lutris ".cache/lutris" ".config/lutris" - ".local/share/bottles" ".local/share/lutris" # Steam diff --git a/modules/apps/games/roblox.nix b/modules/apps/games/roblox.nix @@ -0,0 +1,18 @@ +{ + config, + lib, + ... +}: +{ + ## Roblox ## + config = lib.mkIf (builtins.elem "roblox" config.apps.games) { + warnings = [ "Flatpak support is required to run Roblox" ]; + apps.list = [ "flatpak" ]; + services.flatpak.packages = [ + { + appId = "org.vinegarhq.Sober"; + origin = "flathub"; + } + ]; + }; +} diff --git a/modules/apps/wine.nix b/modules/apps/wine.nix @@ -24,8 +24,8 @@ in package = mkOption { description = "Package to use for 'wine'"; type = types.package; - default = pkgs.winePackages.stable; - example = pkgs.gaming.wine-tkg; + default = pkgs.wineWowPackages.stagingFull; + example = pkgs.gaming.wine-ge; }; }; diff --git a/modules/gui/desktop/pantheon/default.nix b/modules/gui/desktop/pantheon/default.nix @@ -166,7 +166,7 @@ in }; # Flatpak - warnings = [ "Flatpak app support is enabled by default while using Pantheon Desktop" ]; + warnings = [ "Flatpak support is enabled by default for Pantheon Desktop" ]; apps.list = [ "flatpak" ]; services.flatpak = { remotes = [ diff --git a/modules/hardware/gpu.nix b/modules/hardware/gpu.nix @@ -17,7 +17,8 @@ let cfg = config.hardware.gpu; opt = options.hardware.gpu; - mode = config.hardware.cpu.mode == "performance"; + mode = config.hardware.cpu.mode != "powersave"; + gamemode = config.programs.gamemode.enable; in { ## GPU Configuration ## @@ -40,54 +41,62 @@ in ]; }) - (mkIf (cfg.enable && cfg.model == "nvidia") { - services.xserver.videoDrivers = mkForce [ "nvidia" ]; - environment = { - systemPackages = [ pkgs.btop-cuda ]; - variables = { - "__GLX_VENDOR_LIBRARY_NAME" = "nvidia"; - "LIBVA_DRIVER_NAME" = "nvidia"; + (mkIf (cfg.enable && cfg.model == "nvidia") ( + let + hybrid = with config.hardware.nvidia.prime; (amdgpuBusId != "" || intelBusId != ""); + in + { + services.xserver.videoDrivers = mkForce [ "nvidia" ]; + environment = { + systemPackages = [ pkgs.btop-cuda ]; + variables = { + "__GLX_VENDOR_LIBRARY_NAME" = "nvidia"; + "LIBVA_DRIVER_NAME" = "nvidia"; + "GAMEMODERUNEXEC" = + mkIf (hybrid && gamemode) + "env __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only"; + }; }; - }; - boot = { - blacklistedKernelModules = [ "nouveau" ]; - kernelModules = [ - "nvidia" - "nvidia_drm" - "nvidia_modeset" - "nvidia_uvm" - ]; + boot = { + blacklistedKernelModules = [ "nouveau" ]; + kernelModules = [ + "nvidia" + "nvidia_drm" + "nvidia_modeset" + "nvidia_uvm" + ]; - # Wayland Support - kernelParams = [ "nvidia-drm.fbdev=1" ]; + kernelParams = [ + # Wayland Support + "nvidia-drm.fbdev=1" + ]; - extraModprobeConfig = '' - # PAT Support - options nvidia NVreg_UsePageAttributeTable=1 + extraModprobeConfig = '' + # PAT Support + options nvidia NVreg_UsePageAttributeTable=1 - # DDC/CI Support - options nvidia NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100 - ''; - }; + # DDC/CI Support + options nvidia NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100 + ''; + }; - hardware.nvidia = { - modesetting.enable = mkForce true; - nvidiaSettings = mkForce true; - dynamicBoost.enable = true; - powerManagement.enable = true; - prime = - with config.hardware.nvidia.prime; - mkIf (amdgpuBusId != "" || intelBusId != "") { + hardware.nvidia = { + modesetting.enable = mkForce true; + nvidiaSettings = mkForce true; + dynamicBoost.enable = true; + powerManagement.enable = true; + prime = mkIf hybrid { sync.enable = mkForce false; reverseSync.enable = mkForce mode; offload = { - enable = mkForce (!mode); - enableOffloadCmd = mkForce (!mode); + enable = mkForce mode; + enableOffloadCmd = mkForce mode; }; }; - }; - }) + }; + } + )) (mkIf (!cfg.enable && cfg.model == "nvidia") { boot.blacklistedKernelModules = [ diff --git a/site/content/blog/nixos/prelude.md b/site/content/blog/nixos/prelude.md @@ -1,7 +1,7 @@ +++ title = "Prelude" description = "My NixOS Configuration" -date = 2026-01-02 +date = 2026-01-05 [taxonomies] series = ["NixOS Desktop"] @@ -38,9 +38,12 @@ The fear that if you delete the wrong file, mess with the wrong package, or even **NixOS is different.** -Basically, you define a **blueprint** - a single configuration file that describes exactly how you want your computer to function. You want Firefox? You write `firefox` in the file. You wanna set your wallpaper? Just chuck it into the file. +Basically, you define a **blueprint** - a single configuration file that describes exactly how you want your computer to function. +You want Firefox? You write `firefox` in the file. You wanna set your wallpaper? Just chuck it into the file. -After you're done, [Nix](https://github.com/NixOS/nix) looks at it, nods, and builds your entire operating system from scratch to match exactly what you wrote. If you mess up, you just undo the text in the file, and your computer goes back to being perfect. +After you're done, [Nix](https://github.com/NixOS/nix) looks at it, nods, and builds your entire operating system from scratch to match exactly what you wrote. +If you mess up, you just undo the text in the file, and your computer goes back to being perfect. +And oh, lest I forget to mention, you’d never have to deal with the godforsaken dependency hell [^1]. --- @@ -50,19 +53,25 @@ _Now that the theatrics are out of the way, let's proceed to see more of it_ It started innocently enough. I just wanted a system that was **reproducible**. -I began with **Nix Flakes**, the "Gateway Drug" [^1] of the ecosystem. Instead of vaguely gesturing at a repository and hoping for the best, `flake.nix` locks every input dependency of my system to a specific commit hash. It is the ultimate insurance policy: if I compile this system today, or in about 10 years in the midst of an imminent meteor strike that may or may not wipe out all life, I will get the exact same binary output. +I began with **Nix Flakes**, the "Gateway Drug" [^2] of the ecosystem. +Instead of vaguely gesturing at a repository and hoping for the best, `flake.nix` locks every input dependency of my system to a specific commit hash. +It is the ultimate insurance policy: if I compile this system today, or in about 10 years in the midst of an imminent meteor strike, I will get the exact same binary output. But having a reproducible system wasn't enough. It had to be **obedient**. -I pulled in [**Home Manager**](https://github.com/nix-community/home-manager) because configuring the OS wasn't enough; I needed to micromanage my user config files too. Then came [**Stylix**](https://github.com/nix-community/stylix). I declare a single image and a color scheme, and Stylix brutally enforces this theme across everything. It forces CSS into [Waybar](https://github.com/Alexays/Waybar), recompiles all my app themes, and even bullies my terminal into submission. But why stop there? I grabbed [**Spicetify**](https://github.com/Gerg-L/spicetify-nix) to force Spotify to match my aesthetic, and [**Nixcord**](https://github.com/FlameFlag/nixcord) for Discord cuz the default grey was offending my eyes. +I pulled in [**Home Manager**](https://github.com/nix-community/home-manager) because configuring the OS wasn't enough; I needed to micromanage my user config files too. +Then came [**Stylix**](https://github.com/nix-community/stylix). I declare a single image and a color scheme, and Stylix brutally enforces this theme across everything. It forces CSS into [Waybar](https://github.com/Alexays/Waybar), recompiles all my app themes, and even bullies my terminal into submission. +But why stop there? I grabbed [**Spicetify**](https://github.com/Gerg-L/spicetify-nix) to force Spotify to match my aesthetic, and [**Nixcord**](https://github.com/FlameFlag/nixcord) for Discord cuz the default grey was offending my eyes. **"Okay, it's pretty," you say. "But is it useful?"** You have no idea. -I don't "install" development tools. I have a [directory](https://github.com/maydayv7/dotfiles/tree/main/shells) that defines isolated environments for C++, Python, JavaScript and so on. When I `cd` into a project, [Direnv](https://direnv.net/) and [**Lorri**](https://github.com/nix-community/lorri) kick in, and the compiler, linter, LSP and whatnot just _appear_ in my shell. When I leave, they vanish. +I don't "install" development tools. I have a [directory](https://github.com/maydayv7/dotfiles/tree/main/shells) that defines isolated environments for C++, Python, JavaScript and so on. +When I `cd` into a project, [Direnv](https://direnv.net/) and [**Lorri**](https://github.com/nix-community/lorri) kick in, and the compiler, linter, LSP and whatnot along with all of their configuration just _appear_ in my shell. When I leave, they vanish. -Every little thing is specified in code. Like when I open [VS Code](https://code.visualstudio.com/), my settings and extensions are already present, and automatically updated. Heck even my **_Printer_** configuration is defined in a Nix file. Yes, really. +Every little thing is specified in code, from backups to network settings and even complex editor workflows (Thank you for your concern, but I very likey my trusty [VS Code](https://code.visualstudio.com/)). +Heck, even my **_Printer_** configuration is defined in a Nix file. **Oh, you thought that would be enough to satiate me?** @@ -78,7 +87,8 @@ Well I didn't. I still wanted to play games and run Android apps. A normal person would dual-boot or use an emulator. I chose violence. -I run [Waydroid](https://github.com/waydroid/waydroid) to virtualize Android directly on the Linux kernel. Then, for the _pièce de résistance_, I set up [VFIO](https://docs.kernel.org/driver-api/vfio.html) GPU Passthrough [^2]. I pass that GPU directly into a Windows Virtual Machine and use [Looking Glass](https://looking-glass.io/) to stream the video output back to my PC screen with negligible latency. +I run [Waydroid](https://github.com/waydroid/waydroid) to virtualize Android directly on the Linux kernel. +Then, for the _pièce de résistance_, I set up [VFIO](https://docs.kernel.org/driver-api/vfio.html) GPU Passthrough [^3]. I pass that GPU directly into a Windows Virtual Machine and use [Looking Glass](https://looking-glass.io/) to stream the video output back to my PC screen with negligible latency. I've also declaratively configured [**Minecraft Servers**](https://github.com/Infinidoge/nix-minecraft) (that 2 week period lasted for months actually, don't judge) and [Wine](https://www.winehq.org/) applications (shoutout to [Erosanix](https://github.com/emmanuelrosa/erosanix)). @@ -88,7 +98,7 @@ If I buy a new computer today, I don't spend a week installing drivers and recov I clone my repository. I run one single command. -And I go get a coffee. Soon as I return [^3], I spin up a AAA Windows game, inside a VM, displayed on a tiling Linux WM (heck even choose between [Hyprland](https://hypr.land/) and [Niri](https://github.com/YaLTeR/niri)), on a system that deletes and rebuilds itself on every boot. +And I go get a coffee. Soon as I return [^4], I spin up a AAA Windows game, displayed on a tiling Linux WM (heck even choose between [Hyprland](https://hypr.land/) and [Niri](https://github.com/YaLTeR/niri)), on a system that deletes and rebuilds itself on every boot. God, I love NixOS. @@ -102,7 +112,7 @@ And I don't mean "Linux is hard" kind of hard. Its more "I have to relearn how c - **It is not standard Linux**: Most tutorials you find on the internet simply will not work here. You can't just `apt install` your problems away. - **The Documentation is... sparse**: Sometimes you will be reading a manual, and sometimes you will be reading 5-year-old Reddit threads praying for an answer. -- **Patience is key** (_or severe OCD tbh_): If you are not acquainted with the command line, programming languages, random crash logs, or want a computer that "just works" to play games or browse the web, consider yourself warned. Cuz this setup costs time, sanity, and the ability to casually refactor the codebase 2 minutes before a presentation. +- **Patience is key** (_or severe OCD tbh_): If you are not acquainted with the command line, programming languages, random crash logs, or want a computer that "just works" to play games or browse the web, consider yourself warned. Cuz this setup costs time, sanity, and a concerning amount of self-restraint to avoid mutilating your PC. # Still Reading? @@ -163,8 +173,10 @@ _Thanks a lot! ;)_ --- -[^1]: [Meaning](http://gateway-drug.urbanup.com/2175521) ig +[^1]: [Wiki](https://en.wikipedia.org/wiki/Dependency_hell) for life -[^2]: [Arch Wiki](https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF) +[^2]: [Meaning](http://gateway-drug.urbanup.com/2175521) ig -[^3]: T&C Apply ;) +[^3]: [Arch Wiki](https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF) _my love_ + +[^4]: T&C Apply ;)