From 5f7bf1ef53df26f795b049bc987735e2c8a4d15a Mon Sep 17 00:00:00 2001 From: leshy Date: Sun, 18 Jan 2026 06:56:06 +0200 Subject: [PATCH] Revert "Add uv to nix and fix resulting problems (#1021)" This reverts commit 8af8f8f5dcfdd1cf2b86124bfda98f7c741d8681. --- flake.lock | 46 ++++++++++++------------------------ flake.nix | 68 ++++++++++++++++++------------------------------------ 2 files changed, 38 insertions(+), 76 deletions(-) diff --git a/flake.lock b/flake.lock index 94e952d483..402f251030 100644 --- a/flake.lock +++ b/flake.lock @@ -37,20 +37,20 @@ "home-manager": { "inputs": { "nixpkgs": [ + "xome", "nixpkgs" ] }, "locked": { - "lastModified": 1767910483, - "narHash": "sha256-MOU5YdVu4DVwuT5ztXgQpPuRRBjSjUGIdUzOQr9iQOY=", + "lastModified": 1753983724, + "narHash": "sha256-2vlAOJv4lBrE+P1uOGhZ1symyjXTRdn/mz0tZ6faQcg=", "owner": "nix-community", "repo": "home-manager", - "rev": "82fb7dedaad83e5e279127a38ef410bcfac6d77c", + "rev": "7035020a507ed616e2b20c61491ae3eaa8e5462c", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-25.11", "repo": "home-manager", "type": "github" } @@ -63,11 +63,11 @@ "libSource": "libSource" }, "locked": { - "lastModified": 1768416447, - "narHash": "sha256-S0n9qoPXg4P1VxOu5ayiuxk7nJk1kk6FlVevU4y9v5o=", + "lastModified": 1764022662, + "narHash": "sha256-vS3EeyELqCskh88JkUW/ce8A8b3m+iRPLPd4kDRTqPY=", "owner": "jeff-hykin", "repo": "quick-nix-toolkits", - "rev": "dfad23538da813bc0eb5148644af9227e04191f0", + "rev": "de1cc174579ecc7b655de5ba9618548d1b72306c", "type": "github" }, "original": { @@ -78,11 +78,11 @@ }, "libSource": { "locked": { - "lastModified": 1768094297, - "narHash": "sha256-+Mdb/3c09zZPpSfdnO0JdG+a/rgNA4YGuA6n7pvvFBE=", + "lastModified": 1766884708, + "narHash": "sha256-x8nyRwtD0HMeYtX60xuIuZJbwwoI7/UKAdCiATnQNz0=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "a9f5b3ba6295f67949cec77dd2fb9c3876d0070c", + "rev": "15177f81ad356040b4460a676838154cbf7f6213", "type": "github" }, "original": { @@ -108,40 +108,26 @@ }, "nixpkgs": { "locked": { - "lastModified": 1768323494, - "narHash": "sha256-yBXJLE6WCtrGo7LKiB6NOt6nisBEEkguC/lq/rP3zRQ=", + "lastModified": 1748929857, + "narHash": "sha256-lcZQ8RhsmhsK8u7LIFsJhsLh/pzR9yZ8yqpTzyGdj+Q=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2c3e5ec5df46d3aeee2a1da0bfedd74e21f4bf3a", + "rev": "c2a03962b8e24e669fb37b7df10e7c79531ff1a4", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-25.11", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgsSourceWithPreCommit": { - "locked": { - "lastModified": 1767151656, - "narHash": "sha256-ujL2AoYBnJBN262HD95yer7QYUmYp5kFZGYbyCCKxq8=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/f665af0cdb70ed27e1bd8f9fdfecaf451260fc55.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/f665af0cdb70ed27e1bd8f9fdfecaf451260fc55.tar.gz" - } - }, "root": { "inputs": { "diagon": "diagon", "flake-utils": "flake-utils", - "home-manager": "home-manager", "lib": "lib", "nixpkgs": "nixpkgs", - "nixpkgsSourceWithPreCommit": "nixpkgsSourceWithPreCommit", "xome": "xome" } }, @@ -165,9 +151,7 @@ "flake-utils": [ "flake-utils" ], - "home-manager": [ - "home-manager" - ], + "home-manager": "home-manager", "libSource": "libSource_2", "nixpkgs": [ "nixpkgs" diff --git a/flake.nix b/flake.nix index dd09a5f8cc..3a70a0bf2f 100644 --- a/flake.nix +++ b/flake.nix @@ -2,27 +2,20 @@ description = "Project dev environment as Nix shell + DockerTools layered image"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; lib.url = "github:jeff-hykin/quick-nix-toolkits"; lib.inputs.flakeUtils.follows = "flake-utils"; - # home-manager.url = "github:nix-community/home-manager"; - home-manager.url = "github:nix-community/home-manager/release-25.11"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; xome.url = "github:jeff-hykin/xome"; xome.inputs.nixpkgs.follows = "nixpkgs"; xome.inputs.flake-utils.follows = "flake-utils"; - xome.inputs.home-manager.follows = "home-manager"; diagon.url = "github:petertrotman/nixpkgs/Diagon"; - # pre-commit on nixos-25.11 is broken, so we have to use an older version of nixpkgs just for pre-commit - nixpkgsSourceWithPreCommit.url = "https://github.com/NixOS/nixpkgs/archive/f665af0cdb70ed27e1bd8f9fdfecaf451260fc55.tar.gz"; }; - outputs = { self, nixpkgs, flake-utils, lib, xome, diagon, nixpkgsSourceWithPreCommit, ... }@inputs: + outputs = { self, nixpkgs, flake-utils, lib, xome, diagon, ... }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; - nixpkgsWithPreCommit = import nixpkgsSourceWithPreCommit { inherit system; }; # ------------------------------------------------------------ # 1. Shared package list (tool-chain + project deps) @@ -83,8 +76,7 @@ { vals.pkg=pkgs.python312Packages.pip; flags={}; } { vals.pkg=pkgs.python312Packages.setuptools; flags={}; } { vals.pkg=pkgs.python312Packages.virtualenv; flags={}; } - { vals.pkg=pkgs.uv; flags={}; } - { vals.pkg=nixpkgsWithPreCommit.pre-commit; flags={}; } + { vals.pkg=pkgs.pre-commit; flags={}; } ### Runtime deps { vals.pkg=pkgs.portaudio; flags={ldLibraryGroup=true; packageConfGroup=true;}; } @@ -178,33 +170,31 @@ # ------------------------------------------------------------ # 2. group / aggregate our packages # ------------------------------------------------------------ - groups = { - devPackages = aggregation.getAll { attrPath=[ "pkg" ]; }; - ldLibraryPackages = aggregation.getAll { hasAllFlags=[ "ldLibraryGroup" ]; attrPath=[ "pkg" ]; }; - giTypelibPackagesString = aggregation.getAll { - hasAllFlags=[ "giTypelibGroup" ]; - attrPath=[ "pkg" ]; - strAppend="/lib/girepository-1.0"; - strJoin=":"; - }; - packageConfPackagesString = (aggregation.getAll { + devPackages = aggregation.getAll { attrPath=[ "pkg" ]; }; + ldLibraryPackages = aggregation.getAll { hasAllFlags=[ "ldLibraryGroup" ]; attrPath=[ "pkg" ]; }; + giTypelibPackagesString = aggregation.getAll { + hasAllFlags=[ "giTypelibGroup" ]; + attrPath=[ "pkg" ]; + strAppend="/lib/girepository-1.0"; + strJoin=":"; + }; + packageConfPackagesString = (aggregation.getAll { hasAllFlags=[ "packageConfGroup" ]; attrPath=[ "pkg" ]; strAppend="/lib/pkgconfig"; strJoin=":"; - }); - manualPythonPackages = (aggregation.getAll { + }); + manualPythonPackages = (aggregation.getAll { hasAllFlags=[ "manualPythonPackages" ]; attrPath=[ "pkg" ]; strAppend="/lib/python3.${aggregation.mergedVals.pythonMinorVersion}/site-packages"; strJoin=":"; - }); - }; + }); # ------------------------------------------------------------ # 3. Host interactive shell → `nix develop` # ------------------------------------------------------------ - envVarShellHook = '' + shellHook = '' shopt -s nullglob 2>/dev/null || setopt +o nomatch 2>/dev/null || true # allow globs to be empty without throwing an error if [ "$OSTYPE" = "linux-gnu" ]; then export CC="cc-no-usr-include" # basically patching for nix @@ -215,18 +205,15 @@ [ -e "$lib" ] && ln -sf "$lib" "$NVIDIA_LIBS_DIR/" 2>/dev/null done fi - export LD_LIBRARY_PATH="$NVIDIA_LIBS_DIR:${pkgs.lib.makeLibraryPath groups.ldLibraryPackages}:$LD_LIBRARY_PATH" + export LD_LIBRARY_PATH="$NVIDIA_LIBS_DIR:${pkgs.lib.makeLibraryPath ldLibraryPackages}:$LD_LIBRARY_PATH" export LIBRARY_PATH="$LD_LIBRARY_PATH" # fixes python find_library for pyaudio export DISPLAY=:0 - export GI_TYPELIB_PATH="${groups.giTypelibPackagesString}:$GI_TYPELIB_PATH" - export PKG_CONFIG_PATH=${lib.escapeShellArg groups.packageConfPackagesString} - export PYTHONPATH="$PYTHONPATH:"${lib.escapeShellArg groups.manualPythonPackages} + export GI_TYPELIB_PATH="${giTypelibPackagesString}:$GI_TYPELIB_PATH" + export PKG_CONFIG_PATH=${lib.escapeShellArg packageConfPackagesString} + export PYTHONPATH="$PYTHONPATH:"${lib.escapeShellArg manualPythonPackages} # CC, CFLAGS, and LDFLAGS are bascially all for `pip install pyaudio` export CFLAGS="$(pkg-config --cflags portaudio-2.0) $CFLAGS" export LDFLAGS="-L$(pkg-config --variable=libdir portaudio-2.0) $LDFLAGS" - ''; - shellHook = '' - ${envVarShellHook} # without this alias, the pytest uses the non-venv python and fails alias pytest="python -m pytest" @@ -242,7 +229,7 @@ devShells = { # basic shell (blends with your current environment) default = pkgs.mkShell { - buildInputs = groups.devPackages; + buildInputs = devPackages; shellHook = shellHook; }; # strict shell (creates a fake home, only select exteral commands (e.g. sudo) from your system are available) @@ -259,9 +246,7 @@ # https://nix-community.github.io/home-manager/options.xhtml home.homeDirectory = "/tmp/virtual_homes/dimos"; home.stateVersion = "25.11"; - home.packages = groups.devPackages; - # https://github.com/nix-community/home-manager/issues/8336 - targets = if pkgs.stdenv.isLinux then {} else { darwin = {copyApps.enable = false; linkApps.enable = true;}; }; + home.packages = devPackages; programs = { home-manager = { @@ -303,18 +288,11 @@ # ------------------------------------------------------------ imageRoot = pkgs.buildEnv { name = "dimos-image-root"; - paths = groups.devPackages; + paths = devPackages; pathsToLink = [ "/bin" ]; }; in { - # so that other people (and us debugging) can import this flake and use parts as needed - vars = { - inherit inputs pkgs groups aggregation devShells imageRoot; - devPackages = groups.devPackages; - shellHook = envVarShellHook; - fullShellHook = shellHook; - }; ## Local dev shell devShells = devShells;