Squash merge dev into master

This commit is contained in:
alsaiduq-lab 2025-05-21 10:58:37 -06:00
parent 3b40f76557
commit c9341c29c5
12 changed files with 133 additions and 63 deletions

View file

@ -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
];
}

View file

@ -15,8 +15,10 @@
./timezone.nix
./user.nix
./python.nix
./npm.nix
./tailscale.nix
./udiskie.nix
# ./ollama.nix
];
# Enable CUPS to print documents.

View file

@ -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
'';
};
}

View file

@ -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
];
}

View file

@ -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
'';
};
}

View file

@ -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
];
};
}