!tCyGickeVqkHsYjWnh:nixos.org

NixOS Networking

889 Members
Declaratively manage your switching, routing, wireless, tunneling and more.260 Servers

Load older messages


SenderMessageTime
29 Jul 2025
@sandro:supersandro.deSandro 🐧hehe, let me try that 14:47:59
@emilazy:matrix.orgemily you could build with python3 and deploy with minimal but I'm also guessing that's hard for a billion reasons 14:50:04
@sandro:supersandro.deSandro 🐧that shouldn't be that hard to do but then you have no test coverage if something is missing14:58:06
@emilazy:matrix.orgemilyyeah15:03:48
@emilazy:matrix.orgemilywell hopefully IfState is going to have end-to-end NixOS tests… right? :)15:03:57
@emilazy:matrix.orgemilynot like you can unit test most of the really important stuff there15:04:05
@marcel:envs.netMarcel
In reply to @emilazy:matrix.org
well hopefully IfState is going to have end-to-end NixOS tests… right? :)
The funny thing is that he did not really had an idea how to implement automatic tests and them I showed him Nixos tests and now there is nix code upstream. But I've already have VM tests in my nixpkgs fork on the ifstate branch
15:05:00
@sandro:supersandro.deSandro 🐧
diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix
index 5d60226aeb9c..8e38fe089aa9 100644
--- a/pkgs/development/interpreters/python/default.nix
+++ b/pkgs/development/interpreters/python/default.nix
@@ -145,6 +145,54 @@
           pname = "python3-minimal";
         });

+    # Minimal versions of Python (built without optional dependencies)
+    python3Smol =
+      (callPackage ./cpython (
+        {
+          self = __splicedPackages.python3Smol;
+          inherit passthruFun;
+          pythonAttr = "python3Smol";
+          # strip down that python version as much as possible
+          openssl = null;
+          readline = null;
+          ncurses = null;
+          gdbm = null;
+          sqlite = null;
+          tzdata = null;
+          libuuid = null;
+          bzip2 = null;
+          libxcrypt = null;
+          xz = null;
+          stripConfig = true;
+          stripIdlelib = true;
+          stripTests = true;
+          stripTkinter = true;
+          rebuildBytecode = false;
+          stripBytecode = true;
+          includeSiteCustomize = false;
+          enableOptimizations = false;
+          enableLTO = false;
+          mimetypesSupport = false;
+          withExpat = false;
+          withMpdecimal = false;
+          /*
+            The actual 'allowedReferences' attribute is set inside the cpython derivation.
+            This is necessary in order to survive overrides of dependencies.
+          */
+          allowedReferenceNames = [
+            "bashNonInteractive"
+            "libffi"
+            "zlib"
+          ];
+        }
+        // sources.python313
+      )).overrideAttrs
+        (old: {
+          # TODO(@Artturin): Add this to the main cpython expr
+          strictDeps = true;
+          pname = "python3-smol";
+        });
+
     pypy27 = callPackage ./pypy {
       self = __splicedPackages.pypy27;
       sourceVersion = {
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index c0e953a8d19e..14cb4c3e1ef1 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -6578,6 +6578,7 @@
     python313
     python314
     python3Minimal
+    python3Smol
     pypy27
     pypy310
     pypy311

16:25:48
@sandro:supersandro.deSandro 🐧This got me pretty far. pyroute2 is failing for some seemingly unrelated error.16:25:48
@elvishjerricco:matrix.orgElvishJerriccoI'm not 100% opposed to this but I certainly don't like it17:36:52
@elvishjerricco:matrix.orgElvishJerriccoI mean I can think of how to do it with no new features too17:37:08
@emilazy:matrix.orgemilywould you like it if we just… made the closures of things small enough that we can use it for everything?17:37:15
@emilazy:matrix.orgemilywithout the current hacks17:37:23
@elvishjerricco:matrix.orgElvishJerricco i.e. make a derivation that creates symlinks to everything listed in a ${closureInfo}/store-paths 17:37:38
@elvishjerricco:matrix.orgElvishJerriccothat's really not going to happen17:37:47
@emilazy:matrix.orgemilyI genuinely think it could!17:38:04
@emilazy:matrix.orgemilywhat do you think the blockers would be? (we could discuss in the systemd room)17:38:12
@elvishjerricco:matrix.orgElvishJerriccoeven if we split binaries from everything else in every relevant derivation (which is a lot of derivations), there's still way more binaries than necessary in a lot of those derivations17:38:33
@emilazy:matrix.orgemily it doesn't have to be a monolithic bin, we do split out individual binaries into their own outputs when necessary 17:39:02
@elvishjerricco:matrix.orgElvishJerriccoeven still, I don't like the idea of having to carefully watch over every derivation in the initrd dependency tree to make sure that none of them ever leaks something big in for the rest of time.17:40:03
@emilazy:matrix.orgemilywe can have a CI test that asserts on the initrd size17:40:32
@elvishjerricco:matrix.orgElvishJerriccoand having code all over nixpkgs to fix a lot of derivations just for the sake of initrd seems like a bad smell17:40:36
@emilazy:matrix.orgemilywell, a Hydra one rather17:40:36
@emilazy:matrix.orgemilywhich is good to have in general17:40:41
@emilazy:matrix.orgemily(we have it for the ISO)17:40:43
@emilazy:matrix.orgemilyI don't think so. split outputs and feature flags are there to reduce closure size where it matters. we don't like to do it without strong reason, but packages going into initrd is a strong reason17:41:12
@emilazy:matrix.orgemilyand if we can accomplish it without breaking the normal Nix closure mechanism that's better and means that other usecases can also benefit from the reduced closure17:41:48
@elvishjerricco:matrix.orgElvishJerriccoIt just seems like a major burden to be putting on nixpkgs that will require a notable amount of manual effort perpetually. I'm opposed.17:41:58
@emilazy:matrix.orgemilyI think it's also a burden to not be able to put packages in initrd without them breaking surprisingly because their closures got clipped17:42:58
@emilazy:matrix.orgemily do you have examples of things you think would be hard to split up to achieve the same results make-initrd-ng does? 17:43:19

Show newer messages


Back to Room ListRoom Version: 6