From c9341c29c515a406573377c0c2eac89966545038 Mon Sep 17 00:00:00 2001 From: alsaiduq-lab Date: Wed, 21 May 2025 10:58:37 -0600 Subject: [PATCH] Squash merge dev into master --- .gitignore | 2 +- home-manager/modules/emulators.nix | 2 ++ hosts/hardware-configuration.nix | 4 +-- hosts/local-packages.nix | 26 ++++++++++++------- modules/audio.nix | 11 +++++--- modules/default.nix | 2 ++ modules/npm.nix | 41 +++++++++++++++++------------- modules/nvidia.nix | 24 +++++++++++++---- modules/python.nix | 25 +++++++++--------- modules/steam.nix | 21 ++++++++++++--- pkgs/default.nix | 11 ++++---- pkgs/fish-rust/default.nix | 27 ++++++++++++++++---- 12 files changed, 133 insertions(+), 63 deletions(-) diff --git a/.gitignore b/.gitignore index 1579bd4..ceae988 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ backup/ .secrets result - +$HOME .env *.nix.bak diff --git a/home-manager/modules/emulators.nix b/home-manager/modules/emulators.nix index 202382d..87d7615 100644 --- a/home-manager/modules/emulators.nix +++ b/home-manager/modules/emulators.nix @@ -10,5 +10,7 @@ retroarch mednafen joycond + waydroid + shadps4 ]; } diff --git a/hosts/hardware-configuration.nix b/hosts/hardware-configuration.nix index 8b598b7..d703756 100644 --- a/hosts/hardware-configuration.nix +++ b/hosts/hardware-configuration.nix @@ -14,12 +14,12 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/b7877a82-a67d-4362-ad36-ac513d7c0fc6"; + { device = "/dev/disk/by-uuid/dfac5ce5-a84e-4956-8b7d-e7f7f9fd6131"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/5F97-DB57"; + { device = "/dev/disk/by-uuid/1C7F-E72A"; fsType = "vfat"; options = [ "fmask=0077" "dmask=0077" ]; }; diff --git a/hosts/local-packages.nix b/hosts/local-packages.nix index a4f0fe3..c45c791 100644 --- a/hosts/local-packages.nix +++ b/hosts/local-packages.nix @@ -1,3 +1,4 @@ +# TODO: cleanout and repopulate individual packages better { pkgs, lib, @@ -5,11 +6,6 @@ }: let customPkgs = import ../pkgs {inherit pkgs lib;}; in { - imports = [ - ../modules/python.nix - ../modules/npm.nix - ]; - python.enable = true; npm.enable = true; @@ -21,7 +17,13 @@ in { spotify flameshot mpv + linuxHeaders + appimage-run + freetype.dev + zed-editor + pixman udiskie + maim git git-lfs gitAndTools.gh @@ -35,6 +37,7 @@ in { yarn bun deno + obsidian go go-tools gopls @@ -46,7 +49,6 @@ in { cargo-audit rust-analyzer python3Packages.debugpy - customPkgs.python-ngx-lsp gcc stdenv.cc.cc.lib gnumake @@ -62,7 +64,10 @@ in { elixir swift zig + dbus.dev + pkg-config ghc + cacert cabal-install stack haskell-language-server @@ -124,8 +129,7 @@ in { slop dunst pulseaudio - ani-cli - yt-dlp + yt-dlp # might remove for source built version httpie wrk cloudflared @@ -140,10 +144,14 @@ in { sqlite redis sqls - ollama tree-sitter luajitPackages.jsregexp tailscale cachix + portaudio + xorg.libX11 + xorg.libXtst + xorg.libXi + xorg.xorgproto ]; } diff --git a/modules/audio.nix b/modules/audio.nix index 75a62a0..58ac736 100644 --- a/modules/audio.nix +++ b/modules/audio.nix @@ -1,7 +1,4 @@ -{ - pkgs, - ... -}: { +{pkgs, ...}: { security.rtkit.enable = true; services.pipewire = { enable = true; @@ -15,5 +12,11 @@ environment.systemPackages = with pkgs; [ cava pulseaudio + alsa-utils + portaudio + alsa-lib + ffmpeg + pavucontrol + clang ]; } diff --git a/modules/default.nix b/modules/default.nix index 21e2fb5..830bb07 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -15,8 +15,10 @@ ./timezone.nix ./user.nix ./python.nix + ./npm.nix ./tailscale.nix ./udiskie.nix + # ./ollama.nix ]; # Enable CUPS to print documents. diff --git a/modules/npm.nix b/modules/npm.nix index 6317f91..a35bc0c 100644 --- a/modules/npm.nix +++ b/modules/npm.nix @@ -4,12 +4,11 @@ lib, ... }: let - npmGlobalDir = "$HOME/.npm-global"; + npmGlobalDir = "~/.npm-global"; npmConf = pkgs.writeText "npmrc" '' prefix=${npmGlobalDir} - cache=$HOME/.npm - init-module=$HOME/.npm-init.js - node-linker=hoisted + cache=~/.npm + init-module=~/.npm-init.js ''; in { options.npm = { @@ -17,23 +16,31 @@ in { }; config = lib.mkIf config.npm.enable { environment.systemPackages = with pkgs; [ - nodejs + nodejs_22 nodePackages.npm + electron ]; environment.variables = { NPM_CONFIG_PREFIX = npmGlobalDir; - PATH = ["${npmGlobalDir}/bin"]; - NPM_CONFIG_USERCONFIG = "${npmConf}"; + PATH = [ + "${pkgs.nodejs_22}/bin" + "${npmGlobalDir}/bin" + ]; + }; + environment.etc."npmrc".source = npmConf; + systemd.user.services.npm-setup = { + description = "Set up NPM user configuration"; + wantedBy = ["default.target"]; + script = '' + if [ ! -f ~/.npmrc ]; then + cp ${npmConf} ~/.npmrc + chmod u+rw ~/.npmrc + fi + ''; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + }; }; - system.userActivationScripts.setupNpm = '' - mkdir -p ${npmGlobalDir}/bin - mkdir -p $HOME/.npm - if [ ! -f "$HOME/.npmrc" ]; then - cp ${npmConf} $HOME/.npmrc - fi - if [ -d "${npmGlobalDir}" ]; then - chmod -R +rw ${npmGlobalDir} - fi - ''; }; } diff --git a/modules/nvidia.nix b/modules/nvidia.nix index 714e011..eba34a7 100644 --- a/modules/nvidia.nix +++ b/modules/nvidia.nix @@ -6,16 +6,30 @@ services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia = { - modesetting.enable = false; - powerManagement.enable = false; - # Set to true for RTX 4000 series and newer GPUs - open = true; package = config.boot.kernelPackages.nvidiaPackages.stable; + open = true; + modesetting.enable = true; # must be true for Wayland + powerManagement.enable = false; nvidiaSettings = true; }; + hardware.graphics = { + enable = true; + enable32Bit = true; + }; + + programs.nix-ld = { + enable = true; + libraries = with pkgs; [ + stdenv.cc.cc.lib + cudaPackages.cudatoolkit.lib + cudaPackages.cudnn + cudaPackages.nccl + ]; + }; + environment.systemPackages = with pkgs; [ - cudaPackages.cudatoolkit glxinfo + cudaPackages.cudatoolkit ]; } diff --git a/modules/python.nix b/modules/python.nix index c471da8..1f28e83 100644 --- a/modules/python.nix +++ b/modules/python.nix @@ -14,14 +14,15 @@ [packages] numpy = "<2.0.0" ''; + + gccLibPath = "${pkgs.gcc-unwrapped.lib}/lib"; + nvidiaLibPath = "${pkgs.linuxPackages.nvidia_x11}/lib"; + cudaLibPath = "${pkgs.cudatoolkit}/lib"; + pythonEnv = pkgs.python311.buildEnv.override { extraLibs = with py; [ customPkgs.python-rembg - numpy i3ipc - pandas - matplotlib - scipy requests virtualenv ipython @@ -35,7 +36,13 @@ jedi libcst pip + wheel ]; + extraOutputsToInstall = ["out"]; + postBuild = '' + wrapProgram $out/bin/python \ + --prefix LD_LIBRARY_PATH : "${gccLibPath}:${nvidiaLibPath}:${cudaLibPath}" + ''; }; in { options.python = { @@ -46,19 +53,13 @@ in { pythonEnv isort uv + git stdenv.cc.cc.lib python311 ]; environment.variables = { - PIP_PREFIX = "$HOME/.local"; PIP_CONFIG_FILE = "${pipConf}"; - PYTHONPATH = "$HOME/.local/lib/python3.11/site-packages"; + LD_LIBRARY_PATH = lib.mkForce "${gccLibPath}:${nvidiaLibPath}:${cudaLibPath}"; }; - system.userActivationScripts.removeNumpy2 = '' - if [ -d "$HOME/.local/lib/python3.11/site-packages/numpy" ]; then - echo "Removing NumPy from user packages to prevent conflicts..." - rm -rf "$HOME/.local/lib/python3.11/site-packages/numpy"* - fi - ''; }; } diff --git a/modules/steam.nix b/modules/steam.nix index 12e77c0..3f3fa22 100644 --- a/modules/steam.nix +++ b/modules/steam.nix @@ -1,4 +1,9 @@ -{pkgs, ...}: { +{ + pkgs, + lib, + config, + ... +}: { programs.steam = { enable = true; remotePlay.openFirewall = true; @@ -26,8 +31,18 @@ vulkan-validation-layers libstrangle piper + portaudio + alsa-lib + ffmpeg + stdenv.cc.cc.lib ]; - environment.variables = { - LD_LIBRARY_PATH = "${pkgs.mangohud}/lib"; + environment.sessionVariables = { + LD_LIBRARY_PATH = lib.makeLibraryPath [ + pkgs.mangohud + pkgs.portaudio + pkgs.alsa-lib + pkgs.ffmpeg + pkgs.stdenv.cc.cc.lib + ]; }; } diff --git a/pkgs/default.nix b/pkgs/default.nix index 7686ee7..458bc28 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -42,9 +42,10 @@ in { }; }; - python-ngx-lsp = pkgs.callPackage ./python-nginx-language-server { - inherit lib; - fetchFromGitHub = pkgs.fetchFromGitHub; - python311Packages = customPythonPackages; - }; + # removing for now since it seems to work, will leave just in case + # python-ngx-lsp = pkgs.callPackage ./python-nginx-language-server { + # inherit lib; + # fetchFromGitHub = pkgs.fetchFromGitHub; + # python311Packages = customPythonPackages; + #}; } diff --git a/pkgs/fish-rust/default.nix b/pkgs/fish-rust/default.nix index 26ffa67..a6eb042 100644 --- a/pkgs/fish-rust/default.nix +++ b/pkgs/fish-rust/default.nix @@ -5,16 +5,21 @@ ncurses, python3Packages, gettext, + coreutils, + findutils, + gawk, + groff, + xsel, }: rustPlatform.buildRustPackage rec { pname = "fish"; - version = "4.0.1-2025-03-16-rust-${builtins.substring 0 7 "642ec399ca17bbde973dc20461335396fe922e4c"}"; + version = "4.0.2-2025-04-20-${builtins.substring 0 7 "489d5d1733de5d10328e948c7683da198c5859c0"}"; src = fetchgit { url = "https://github.com/fish-shell/fish-shell.git"; - rev = "642ec399ca17bbde973dc20461335396fe922e4c"; + rev = "489d5d1733de5d10328e948c7683da198c5859c0"; fetchSubmodules = true; - sha256 = "sha256-N01RmhyTNMtF8lNmnfC/uvR387UZFx6doQBICtTGWSU="; + sha256 = "sha256-Q0sGAIjsvQsjvAnZlcyB2VldOpmiBYPliF5uyOndyyA="; }; cargoLock = { @@ -25,8 +30,20 @@ rustPlatform.buildRustPackage rec { }; }; - buildInputs = [ncurses gettext]; - nativeBuildInputs = with python3Packages; [sphinx sphinx_rtd_theme]; + buildInputs = [ + ncurses + gettext + coreutils + findutils + gawk + groff + xsel + ]; + nativeBuildInputs = with python3Packages; [ + sphinx + sphinx_rtd_theme + python + ]; preBuild = '' export FISH_BUILD_VERSION="${version}"