# Here goes the stuff that will only be enabled on the desktop { pkgs, nixosConfig, config, hostname, lib, mylib, username, inputs, ... }: { config = { homemodules = { btop.cuda = true; # This has been relocated here from the default config, # because it forces en-US keyboard layout. fcitx.enable = true; helix.enable = true; hyprland = { keyboard = { layout = "us"; variant = "altgr-intl"; option = "nodeadkeys"; }; monitors = { "DP-1" = { width = 3440; height = 1440; rate = 165; x = 1920; y = 0; scale = 1; bitdepth = 10; cm = "auto"; # with render:cm_auto_hdr, we don't need hdr here }; "DP-2" = { width = 1920; height = 1080; rate = 60; x = 0; y = 0; scale = 1; }; }; workspaces = { "DP-1" = [1 2 3 4 5 6 7 8 9]; "DP-2" = [10]; }; autostart = { delayed = [ "fcitx5" ]; }; floating = [ { class = "fcitx"; } ]; }; waybar.monitors = ["DP-1" "DP-2"]; vscode.enable = true; zed.enable = true; }; programs = { claude-code = { enable = true; enableMcpIntegration = true; }; codexDesktopLinux = { enable = true; linuxFeatures = [ "frameless-titlebar" "global-dictation" "read-aloud" "tray-usage" "ui-tweaks" ]; }; # NOTE: Starts extremely slow ghostty = { enable = true; enableFishIntegration = true; systemd.enable = true; settings = { theme = "catppuccin-mocha"; font-family = config.homemodules.color.font; font-size = 12; window-padding-x = 10; window-padding-y = 10; adjust-cursor-thickness = 1; cursor-click-to-move = true; gtk-single-instance = true; # link-previews = true; }; themes = let color = config.homemodules.color; in { catppuccin-mocha = { background = color.hex.base; cursor-color = color.hex.rosewater; foreground = color.hex.text; palette = [ "0=#${color.hex.surface1}" "1=#${color.hex.red}" "2=#${color.hex.green}" "3=#${color.hex.yellow}" "4=#${color.hex.blue}" "5=#${color.hex.pink}" "6=#${color.hex.teal}" "7=#${color.hex.subtext1}" "8=#${color.hex.surface2}" "9=#${color.hex.red}" "10=#${color.hex.green}" "11=#${color.hex.yellow}" "12=#${color.hex.blue}" "13=#${color.hex.pink}" "14=#${color.hex.teal}" "15=#${color.hex.subtext0}" ]; selection-background = color.hex.surface1; selection-foreground = color.hex.text; }; }; }; mcp = { enable = true; servers = { nixos = { command = "uvx"; args = ["mcp-nixos"]; }; svelte = { # claude mcp add -t stdio -s [scope] svelte -- npx -y @sveltejs/mcp command = "npx"; args = ["-y" "@sveltejs/mcp"]; type = "stdio"; }; shadcn = { # npx shadcn@latest mcp init --client claude command = "npx"; args = ["-y" "shadcn@latest" "mcp"]; }; }; }; opencode = { enable = true; enableMcpIntegration = true; extraPackages = with pkgs; [ # opencode-claude-auth # Installed using npm ]; # Writes opencode.json settings = { attachment = { image = { auto_resize = true; max_width = 2000; max_height = 2000; max_base64_bytes = 5242880; }; }; autoupdate = false; compaction = { auto = true; prune = true; reserved = 10000; }; default_agent = "plan"; enabled_providers = [ "opencode" "opencode-go" "anthropic" "lmstudio" ]; formatter = { nixfmt = { disabled = true; }; alejandra = { command = ["alejandra" "$FILE"]; extensions = [".nix"]; }; perltidy = { command = ["perltidy" "$FILE"]; extensions = [".pl"]; }; }; lsp = { nixd = { command = ["nixd"]; extensions = [".nix"]; initialization = { preferences = { nixd = { nixpkgs = {expr = "import {}";}; options = { nixos = {expr = "(builtins.getFlake \"/home/${username}/NixFlake\").nixosConfigurations.${hostname}.options";}; home-manager = {expr = "(builtins.getFlake \"/home/${username}/NixFlake\").nixosConfigurations.\"${hostname}\".options.home-manager.users.type.getSubOptions []";}; }; diagnostic = { suppress = ["sema-escaping-with" "var-bind-to-this" "escaping-this-with"]; }; }; }; }; }; perlnavigator = { command = ["perlnavigator"]; extensions = [".pl"]; initialization = { preferences = {}; }; }; # perlpls = { # command = ["pls"]; # extensions = [".pl"]; # initialization = { # preferences = { # perl = { # perlcritic = {enabled = false;}; # syntax = {enabled = true;}; # }; # }; # }; # }; r-language-server = { command = ["R" "--no-echo" "-e" "languageserver::run()"]; extensions = [".r" ".rmd" ".quarto"]; }; }; permission = { "*" = "ask"; "bash" = { "*" = "ask"; "ls *" = "allow"; "find *" = "ask"; # Don't want find -exec "file *" = "allow"; "wc *" = "allow"; "grep *" = "allow"; "rg *" = "allow"; "test *" = "allow"; "echo *" = "allow"; "which *" = "allow"; "pwd *" = "allow"; "dirname *" = "allow"; "basename *" = "allow"; "readlink *" = "allow"; "cat *.env" = "deny"; "cat *.env.*" = "deny"; "cat *.env.example" = "allow"; "printenv *" = "deny"; "env *" = "deny"; "nix eval *" = "allow"; "nix flake metadata *" = "allow"; "nix flake show *" = "allow"; "nix path-info *" = "allow"; "nix why-depends *" = "allow"; "nix derivation show *" = "allow"; "nix store ping *" = "allow"; "nix stire diff-closures *" = "allow"; "git status *" = "allow"; "git log *" = "allow"; "git diff *" = "allow"; }; "external_directory" = { "/nix/store/**" = "allow"; "/tmp" = "allow"; "/tmp/*" = "allow"; }; "read" = { "*" = "allow"; "*.env" = "deny"; "*.env.*" = "deny"; "*.env.example" = "allow"; }; "grep" = "allow"; "glob" = "allow"; "lsp" = "allow"; "skill" = "allow"; "task" = "ask"; "todowrite" = "allow"; "webfetch" = "allow"; "websearch" = "allow"; "question" = "allow"; }; plugin = [ "opencode-claude-auth@latest" # https://github.com/griffinmartin/opencode-claude-auth "@tarquinen/opencode-dcp@latest" # better compacting # "opencode-lmstudio@0.3.1" # "@slkiser/opencode-quota" ]; share = "disabled"; shell = "fish"; snapshot = false; watcher = { ignore = ["node_modules/**" "dist/**" ".git/**"]; }; }; # Writes tui.json tui = { theme = "system"; diff_style = "auto"; mouse = true; attention = { enabled = true; notifications = true; sound = true; volume = "0.3"; }; }; agents = {}; commands = {}; context = ''''; skills = {}; tools = {}; }; }; home = let # Extra config to make Rider Unity integration work dotnetCore = with pkgs.dotnetCorePackages; combinePackages [ # sdk_6_0_1xx # Is EOL # sdk_7_0_3xx # Is EOL sdk_8_0_3xx sdk_9_0_3xx ]; extra-path = with pkgs; [ dotnetCore dotnetPackages.Nuget mono # msbuild # Add any extra binaries you want accessible to Rider here ]; extra-lib = with pkgs; [ # Add any extra libraries you want accessible to Rider here ]; rider-unity = pkgs.jetbrains.rider.overrideAttrs (attrs: { postInstall = '' # Wrap rider with extra tools and libraries mv $out/bin/rider $out/bin/.rider-toolless makeWrapper $out/bin/.rider-toolless $out/bin/rider \ --argv0 rider \ --prefix PATH : "${lib.makeBinPath extra-path}" \ --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath extra-lib}" # Making Unity Rider plugin work! # The plugin expects the binary to be at /rider/bin/rider, # with bundled files at /rider/ # It does this by going up two directories from the binary path # Our rider binary is at $out/bin/rider, so we need to link $out/rider/ to $out/ shopt -s extglob ln -s $out/rider/!(bin) $out/ shopt -u extglob '' + attrs.postInstall or ""; }); in { packages = with pkgs; [ # Intel FPGA design software # quartus-prime-lite jetbrains.clion # jetbrains.rust-rover # jetbrains.pycharm-professional # jetbrains.idea-ultimate # jetbrains.webstorm # jetbrains.rider # ghidra # launch with _JAVA_AWT_WM_NONREPARENTING=1 (use programs.ghidra) # zed-editor # Using module # vscode # Using module # Unity Stuff # unityhub # rider-unity # dotnetCore # mono # steam-run-free # nix-alien doesn't seem to run unity apps, this does... inputs.hytale-launcher.packages.${pkgs.stdenv.hostPlatform.system}.default (blender.override {cudaSupport = true;}) godot_4 (obs-studio.override {cudaSupport = true;}) kdePackages.kdenlive # davinci-resolve krita makemkv lrcget # msty jellyfin-desktop jellyfin-mpv-shim tiddl picard handbrake teamspeak6-client # virt-manager # use system program option virt-viewer gnome-boxes # doesn't list VMs imported using virsh steam-devices-udev-rules ]; file = lib.mkMerge [ { # ".local/share/applications/jetbrains-rider.desktop".source = let # desktopFile = pkgs.makeDesktopItem { # name = "jetbrains-rider"; # desktopName = "Rider"; # exec = "\"${rider-unity}/bin/rider\""; # icon = "rider"; # type = "Application"; # # Don't show desktop icon in search or run launcher # extraConfig.NoDisplay = "true"; # }; # in "${desktopFile}/share/applications/jetbrains-rider.desktop"; ".var/app/com.valvesoftware.Steam/config/MangoHud/MangoHud.conf".source = ../../../config/mangohud/MangoHud.conf; } (lib.optionalAttrs (mylib.modules.contains config.home.packages pkgs.makemkv) { ".MakeMKV/settings.conf".source = config.lib.file.mkOutOfStoreSymlink "${nixosConfig.sops.templates."makemkv-settings.conf".path}"; }) ]; # Do not change. # This marks the version when NixOS was installed for backwards-compatibility. stateVersion = "22.05"; }; # Cyberpunk 2077 NXM handler xdg.desktopEntries."modorganizer2-nxm-handler-cyberpunk" = { type = "Application"; categories = ["Game"]; name = "Mod Organizer 2 NXM Handler (Cyberpunk 2077)"; mimeType = ["x-scheme-handler/nxm"]; exec = let # Paths seen from inside the Flatpak Steam sandbox steam = "$HOME/.steam/steam"; steamapps = "$HOME/Games/SteamLibrary/steamapps"; proton = "Proton - Experimental"; # Runs inside flatpak's sandbox innerCommand = '' export STEAM_COMPAT_CLIENT_INSTALL_PATH="${steam}" export STEAM_COMPAT_DATA_PATH="${steamapps}/compatdata/1091500" exec "${steam}/steamapps/common/${proton}/proton" run \ "$HOME/Games/CyberpunkMO2/nxmhandler.exe" "$1" ''; # Important: Run through flatpak's/steam's runtimes nxmHandler = pkgs.writeShellScript "cyberpunk-nxm-handler" '' exec flatpak run --command=sh com.valvesoftware.Steam -c ${lib.escapeShellArg innerCommand} _ "$1" ''; in "${nxmHandler} %u"; }; services = { flatpak = { packages = [ "com.valvesoftware.Steam" "com.valvesoftware.Steam.Utility.steamtinkerlaunch" "org.freedesktop.Platform.VulkanLayer.gamescope/x86_64/25.08" # TODO: Doesn't work "org.freedesktop.Platform.VulkanLayer.MangoHud/x86_64/25.08" "io.github.Foldex.AdwSteamGtk" "com.vysp3r.ProtonPlus" "com.github.Matoking.protontricks" # "net.davidotek.pupgui2" "org.prismlauncher.PrismLauncher" "com.usebottles.bottles" "io.github.lawstorant.boxflat" "org.onlyoffice.desktopeditors" # "com.unity.UnityHub" ]; overrides = { "org.prismlauncher.PrismLauncher".Context = { filesystems = [ "${config.home.homeDirectory}/Downloads" "/tmp" # To allow temporary world folder creation for datapack installation ]; }; "com.github.Matoking.protontricks".Context = { filesystems = [ "${config.home.homeDirectory}/.var/app/com.valvesoftware.Steam" "${config.home.homeDirectory}/Games" ]; }; "com.valvesoftware.Steam" = { Environment = { PATH = "/app/bin:/app/utils/bin:/usr/bin:/usr/lib/extensions/vulkan/gamescope/bin"; }; Context = { filesystems = [ "${config.home.homeDirectory}/Games" # This is Proton-GE installed from flatpak. ProtonUpQT doesn't require it. "/var/lib/flatpak/runtime/com.valvesoftware.Steam.CompatibilityTool.Proton-GE" # This is gamescope installed from flatpak "/usr/lib/extensions/vulkan/gamescope/bin" # So ModOrganizer2 can load this plugin symlinked from here "${config.home.homeDirectory}/Projects/ModOrganizer2_Cyberpunk_Plugin" ]; }; }; "com.valvesoftware.Steam.Utility.steamtinkerlaunch".Context = { filesystems = [ "${config.home.homeDirectory}/.var/app/com.valvesoftware.Steam" "${config.home.homeDirectory}/Games" ]; }; "net.davidotek.pupgui2".Context = { filesystems = [ "${config.home.homeDirectory}/.var/app/com.valvesoftware.Steam" "${config.home.homeDirectory}/Games" ]; }; "com.vysp3r.ProtonPlus".Context = { filesystems = [ "${config.home.homeDirectory}/.var/app/com.valvesoftware.Steam" "${config.home.homeDirectory}/Games" ]; }; "com.usebottles.bottles".Context = { filesystems = [ "${config.home.homeDirectory}/.var/app/com.valvesoftware.Steam" "${config.home.homeDirectory}/Games" ]; }; "com.unity.UnityHub".Context = { filesystems = [ "${config.home.homeDirectory}/Unity" "${config.home.homeDirectory}/Projects" ]; }; }; }; }; }; }