!djTaTBQyWEPRQxrPTb:nixos.org

Nixpkgs Architecture Team

228 Members
https://github.com/nixpkgs-architecture, weekly public meetings on Wednesday 15:00-16:00 UTC at https://meet.jit.si/nixpkgs-architecture53 Servers

Load older messages


SenderMessageTime
11 Jul 2022
@whentze:matrix.orgWanja Hentze joined the room.12:39:14
@hexa:lossy.networkhexa joined the room.12:45:26
@profpatsch:augsburg.oneprofpatsch joined the room.12:45:49
@andreas.schraegle:helsinki-systems.deAndreas SchrΓ€gle joined the room.12:49:24
@toonn:matrix.orgtoonn joined the room.13:31:16
@winterqt:nixos.devWinter (she/her) joined the room.15:18:42
@kayla.fire:matrix.orgkayla.fire joined the room.18:48:48
@sandro:supersandro.deSandro 🐧
In reply to @j-k:matrix.org

Slightly related: I just noticed /nix/var/log/nix/drvs/ has a 2 letter prefix sub dir pattern

Ξ» ls /nix/var/log/nix/drvs/
ο„• 00  ο„• 0s  ο„• 1l  ο„• 2f  ο„• 38  ο„• 42  ο„• 4w  ο„• 5n  ο„• 6h  ο„• 7a # ... etc ...
Really common for hash based directory structures to keep the amount of things in a directory smaller
23:54:06
@sandro:supersandro.deSandro 🐧Because if you have a lot a lot of files in a directory listing that gets show23:54:32
@sandro:supersandro.deSandro 🐧* Because if you have a lot a lot of files in a directory listing that gets slow23:54:37
12 Jul 2022
@kevincox:matrix.orgkevincox /nix/store laughs. 00:42:06
@kevincox:matrix.orgkevincoxBut honestly it is generally better to let the storage system do something optimal. Especially for this case where the prefix will depend on human-chosen names. However we know at least that GitHub handles this poorly and that Git doesn't do anything clever at the moment. So we do need to meet our tools.00:43:23
@yorik.sar:matrix.orgyorik.sar

/nix/store is stored locally, rarely listed and mostly accessed by the entry name. That's why we get get away with FS choosing optimal representation for it (hash tree usually).
Nixpkgs is stored in Git and often listed in editors and UIs, all of them are not great with huge directories, so we should optimize for smaller ones.

I wonder why such nested structure was chosen for logs though.

05:40:25
@hsngrmpf:matrix.orgDavHau
In reply to @kevincox:matrix.org

I'm thinking something like this. (For a flat solution)

all-packages = builtin.proxyAttrs {
  lookup = name: pkgs.callPackage (import "pkgs/${name}.nix");
  list-keys = # List all packages and return a list or something here.
};

Then for the common case of nix-build -A foo it just calls lookup "foo" and only that package is loaded.

I really like that idea. Especially as it allows to add a package by just dropping a file somewhere. Having to edit some all-packages.nix is really unnecessary overhead.

Assuming overrides are still a thing at the time when this gets implemented, we'd have to find a new solution for the default callPackage overrides that are currently done in all-packages.nix for some packages.
I see the following options for this:

  1. Create one central overrides file for default callPackage overrides (I think this is a bad idea)
  2. Manage the overrides within the .nix of each package, though then it requires a reference to pkgs.
  3. Deprecate in-line overrides all-together and enforce the creation of an actual individual package for each required package variation. This would make every existing package variation referenceable by an actual attribute name, which is great for further overriding by the user.

For example, if we have packages hello and foobar, where hello depends on an overridden foobar, we could have the following files:

/fo/ob/foobar.nix
/he/ll/hello.nix
/he/ll/foobar.nix  -  (the overridden foobar package for hello)

/he/ll/foobar.nix could look like this:

{foobar,}:
foobar.overrideAttrs (old: {
   pname = "foobar-for-hello";
})
08:47:07
@hsngrmpf:matrix.orgDavHau If we have a flat package structure another question to answer would be, how are package name collisions treated.
Where to put the pythonhello package, or the nodejs hello package, and how should those be named?
08:55:56
@k900:0upti.meK900 I'd expect to still have stuff like python3Packages 08:56:29
@k900:0upti.meK900Maybe in a special top-level directory08:56:36
@yorik.sar:matrix.orgyorik.sar Maybe we should have separate package sets? Like now we have packages from different ecosystems for Python, JS, Ruby, etc, we could keep them separate in separate folders, keeping the nesting structure inside (or not, depending on how they are being maintained). Then we could hook them up to the "root" package set via something like /py/th/python3Packages.nix 09:37:32
@yorik.sar:matrix.orgyorik.sarThis could also allow us to separate nixpkgs along these lines into separate repos, if needed.09:37:38
@yorik.sar:matrix.orgyorik.sar We could then still introduce "thematic" package sets later if needed (KDE, Gnome, "desktop apps" Congress to mind) 09:40:05
@yorik.sar:matrix.orgyorik.sarIf we go this way, we could consider putting stdenvs and their dependencies into separate "sets".11:45:35
@kevincox:matrix.orgkevincox
In reply to @k900:0upti.me
Maybe in a special top-level directory
Or just python3Packages is a "regular" package in terms of the first lookup. So maybe it is py/python3Packages.nix but then it can do it's own lookup, maybe using the same scheme or maybe using a different one.
11:55:46
13 Jul 2022
@gytis-ivaskevicius:matrix.orgGytis IvaskeviciusRedacted or Malformed Event10:31:53
@gytis-ivaskevicius:matrix.orgGytis Ivaskevicius

I noticed that I sparked quite a discussion πŸ˜„ So I ideally would see:

  • Folder structure representing attrs structure. If package is in top level - under root directory. If there is a package group (gnome, pythonPackages, etc) - then it should be under directory with the same name
  • I got a feeling that all-packages.nix is necessary otherwise we would be impacting performance but I have not tested it (also we could autogenerate such file)
  • all these overrides should be separated from all-packages.nix I'd say one file for 'dumb package definitions' and another for overwrites
  • Consider exposing blueprints https://github.com/gytis-ivaskevicius/nix-patterns/blob/master/blueprints/flake.nix#L7-L10 instead of derivations and mapAttrs when necessary (is it more work than its worth?)0
10:35:37
@gytis-ivaskevicius:matrix.orgGytis Ivaskevicius
nix-repl> length (attrNames pkgs)
16563
10:36:29
@gytis-ivaskevicius:matrix.orgGytis IvaskeviciusπŸ‘€10:36:36
@kevincox:matrix.orgkevincox I feel that having an all-packages.nix can't exist for performance reasons because we don't want to parse and evaluate this ever growing file. If you can just resolve an attr into a file and load it you avoid having to load that into memory and the cost is only the definitions of the closure. 10:38:09
@kevincox:matrix.orgkevincox

I wonder if we need overrides in nixpkgs. Maybe we can give every modified package a name and let the called package use that name. (basically no more python = python38). But that does add some API instability for user overrides. Maybe a multi-level approach can work?

I like the look of blueprints but how does this work for user-overrides?

10:40:56
@gytis-ivaskevicius:matrix.orgGytis IvaskeviciusI think we should first provide options to not to use overwrites and maybe few years down the line we can remove those alltogether10:41:43
@k900:0upti.meK900 I feel like we need something like overrideAttrs, but stuff like override should be exposed as (args) -> derivation functions 10:41:54

Show newer messages


Back to Room ListRoom Version: 9