diff --git a/flake.nix b/flake.nix index ba08853..339b028 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ nixpkgs-test.url = "github:NixOS/nixpkgs/refs/pull/379645/merge"; # for testing nixpkgs-edge.url = "https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz"; # len("edge") == 4 nixpkgs-2505.url = "https://nixos.org/channels/nixos-25.05/nixexprs.tar.xz"; - nixpkgs-2411.url = "https://nixos.org/channels/nixos-24.11/nixexprs.tar.xz"; + nixpkgs-2411.url = "https://nixos.org/channels/nixos-24.11/nixexprs.tar.xz"; # for old docs nixpkgs-2405.url = "https://nixos.org/channels/nixos-24.05/nixexprs.tar.xz"; # for old docs nixpkgs-2311.url = "https://nixos.org/channels/nixos-23.11/nixexprs.tar.xz"; # for old docs nixpkgs-2305.url = "https://nixos.org/channels/nixos-23.05/nixexprs.tar.xz"; # for old docs @@ -309,7 +309,7 @@ envrc = mkShell { } envrc-pkgs; envrc-remotes = mkShell { } (envrc-pkgs ++ [ pkgs.remote-exec - pkgs.yq + pkgs.yq # TODO: remove pkgs.rsync ]); remoteenv = mkShell { } [ diff --git a/hardware/gpu/cuda-common.nix b/hardware/gpu/cuda-common.nix index 147f8ca..4aa9df4 100644 --- a/hardware/gpu/cuda-common.nix +++ b/hardware/gpu/cuda-common.nix @@ -21,11 +21,7 @@ lib.mkMerge [ }) { - nixpkgs.config.openglSupport = true; # why is this not set by hardware.opengl.enable ? - nixpkgs.config.cudaSupport = true; - nixpkgs.config.vdpauSupport = true; - nixpkgs.config.vaapiSupport = true; - nixpkgs.config.nvidiaSupport = true; + nixpkgs.config.cudaSupport= true; nixpkgs.config.allowUnfreePredicate = pkg: @@ -39,6 +35,16 @@ lib.mkMerge [ (lib.hasInfix "cublas" pkgname) ]; + # avoid expensive rebuilds + nixpkgs.config.packageOverrides = pkgs: { + firefox-unwrapped = pkgs.firefox-unwrapped.override (old: { + onnxruntime = old.onnxruntime.override { + cudaSupport = false; + ncclSupport = false; + }; + }); + }; + } /* lib.mkIf (lib.versionAtLeast lib.version "24.11") { */ (lib.optionalAttrs (lib.versionAtLeast lib.version "24.11") { diff --git a/hosts/nixos/garp/configuration.nix b/hosts/nixos/garp/configuration.nix index be369ae..96f0997 100644 --- a/hosts/nixos/garp/configuration.nix +++ b/hosts/nixos/garp/configuration.nix @@ -27,12 +27,13 @@ inputs.nixos-hardware.nixosModules.common-pc-ssd inputs.nixos-hardware.nixosModules.common-cpu-intel-cpu-only ../../../hardware/gpu/cuda.nix + ../../../hardware/gpu/zluda.nix ../../../profiles/nix-ld.nix ../../../profiles/sshd ../../../profiles/nix-cgroups.nix #../../../profiles/no-suspend.nix - #../../../profiles/oci/podman.nix + # ../../../profiles/oci/podman.nix ../../../profiles/oci/docker.nix ../../../users/pbsds diff --git a/hosts/nixos/nord/configuration.nix b/hosts/nixos/nord/configuration.nix index 539e13f..a52610e 100644 --- a/hosts/nixos/nord/configuration.nix +++ b/hosts/nixos/nord/configuration.nix @@ -19,6 +19,16 @@ systemd.services."getty@tty1".enable = false; systemd.services."autovt@tty1".enable = false; + # for testing only, not for building + # boot.binfmt.addEmulatedSystemsToNixSandbox = false; + # boot.binfmt.emulatedSystems = [ + # # "armv7l-linux" + # # "aarch64-linux" + # # "riscv64-linux" + # "i686-windows" + # "x86_64-windows" + # ]; + imports = [ ./hardware-configuration.nix inputs.nixos-hardware.nixosModules.common-pc diff --git a/hosts/nixos/sopp/configuration.nix b/hosts/nixos/sopp/configuration.nix index fa18b9f..1db94c3 100644 --- a/hosts/nixos/sopp/configuration.nix +++ b/hosts/nixos/sopp/configuration.nix @@ -50,6 +50,7 @@ inputs.nixos-hardware.nixosModules.common-cpu-intel ../../../hardware/gpu/intel.nix ../../../hardware/gpu/cuda.nix + ../../../hardware/gpu/zluda.nix ../../../hardware/printer/hp-laserjet-p1005.nix ../../../hardware/printer/share.nix @@ -88,14 +89,14 @@ hardware.bluetooth.enable = true; environment.systemPackages = [ - pkgs.davinci-resolve + # pkgs.davinci-resolve # broken on cuda pkgs.krita - pkgs.pbsds.v4l2-play - pkgs.librealsense-gui - pkgs.freecad + # pkgs.pbsds.v4l2-play + # pkgs.librealsense-gui + # pkgs.freecad pkgs.chromium - pkgs.cemu - pkgs.azahar # citra + # pkgs.cemu + # pkgs.azahar # citra ]; diff --git a/justfile b/justfile index a032685..3725bf8 100644 --- a/justfile +++ b/justfile @@ -126,12 +126,12 @@ home-why-depends $attrpath: .#nixosConfigurations."${hostname}".config.home-manager.users."${username}".home.activationPackage \ .#nixosConfigurations."${hostname}".pkgs."$attrpath" -home-eval: +home-eval attrpath="home.activationPackage" *_: #!/usr/bin/env -S bash -euo pipefail hostname="$(hostname)" username="$(whoami)" set -x - nix eval --log-format raw .#nixosConfigurations."${hostname}".config.home-manager.users."${username}".home.activationPackage + nix eval --log-format raw .#nixosConfigurations."${hostname}".config.home-manager.users."${username}"."$attrpath" --show-trace "${@:2}" # TODO: fallback to .#homeConfigurations.$(whoami) ? # TODO: alternative behaviour for system-manager and nix-darwin diff --git a/profiles/desktop/steam.nix b/profiles/desktop/steam.nix index e435c68..bc23b82 100644 --- a/profiles/desktop/steam.nix +++ b/profiles/desktop/steam.nix @@ -1,5 +1,4 @@ -{ config, pkgs, lib, ... }: -lib.mkMerge [ +{ pkgs, lib, ... }: { programs.steam.enable = true; programs.steam.remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play @@ -14,14 +13,6 @@ lib.mkMerge [ "steam-runtime" ]; - environment.systemPackages = [ - # ((pkgs.steam-run.override { - # steam-unwrapped = null; - # }).overrideAttrs { - # name = "fhs-run"; - # }) - ]; - programs.bash.shellInit = '' if [ -n "''${BASH_VERSION:-}" ]; then complete -F _command steam-run @@ -81,29 +72,23 @@ lib.mkMerge [ #services.joycond.enable = true; -} -(lib.optionalAttrs (lib.versionOlder lib.version "24.11") { - hardware.opengl.enable = true; - hardware.opengl.driSupport = true; - hardware.opengl.driSupport32Bit = true; - hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ]; -}) -(lib.optionalAttrs (lib.versionAtLeast lib.version "24.11") { hardware.graphics.enable = true; hardware.graphics.enable32Bit = true; hardware.graphics.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ]; -}) -{ environment.systemPackages = with pkgs; [ - steam-tui + # steam-tui steamcmd + #winetricks #protontricks - wineWowPackages.full + # wineWowPackages.full #wineWowPackages.waylandFull + # bottles + # lutris + # nice to have jstest-gtk antimicrox @@ -119,4 +104,3 @@ lib.mkMerge [ ]; } -] diff --git a/profiles/nix-ld.nix b/profiles/nix-ld.nix index 197ab76..8f9cf26 100644 --- a/profiles/nix-ld.nix +++ b/profiles/nix-ld.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ lib, pkgs, ... }: # TODO: # this is what i currently do to use conda/pypi with nix-ld: @@ -10,6 +10,14 @@ { programs.nix-ld.enable = true; + # environment.sessionVariables = { + # NIX_LD_LIBRARY_PATH = lib.mkForce (lib.concatStringsSep ":" [ + # "/run/opengl-driver/lib" + # "/run/opengl-driver-32/lib" + # "/run/current-system/sw/share/nix-ld/lib" + # ]); + # }; + programs.nix-ld.libraries = with pkgs; [ acl at-spi2-atk diff --git a/users/pbsds/home/profiles/shell.nix b/users/pbsds/home/profiles/shell.nix index da79b36..09f3e2a 100644 --- a/users/pbsds/home/profiles/shell.nix +++ b/users/pbsds/home/profiles/shell.nix @@ -231,8 +231,14 @@ in # comby # ast-based source code rewrite gron fastgron # grep-able json jq # json query - # xq gojq # faster jq alternatives - yq # jq wrapper with more formats, includes yq (yaml), xq (xml) and tomlq + xq gojq # faster jq alternatives + # yq # jq wrapper with more formats, includes yq (yaml), xq (xml) and tomlq + (pkgs.linkFarm yq { + # jq wrapper with more formats, includes yq (yaml), xq (xml) and tomlq + "bin/yq" = lib.getExe' pkgs.yq "yq"; + "bin/tomlq" = lib.getExe' pkgs.yq "tomlq"; + # "bin/xq" = lib.getExe' pkgs.yq "xq"; # conflict with the speedy xq + }) fx # jq tui viewer ijq # interactive jq #fq # jq for binaries