2023-12-15 Nix team meeting minutes #112

(with apologies for the delay)

Attendees: @regnat, @tomberek, @roberth, @edolstra

Agenda

  • Triaging
  • Issue discussion

Triaging

The `git://` flake-URL type doesn't work · Issue #9612 · NixOS/nix · GitHub

https://github.com/NixOS/nix/issues/9612#issuecomment-1888476200

`nix profile` has bad UX · Issue #7966 · NixOS/nix · GitHub

Needs more discussion

→ To discuss

Rename `tarball-ttl` to `fetch-ttl` · Issue #8568 · NixOS/nix · GitHub

Broad agreement, marked as “idea approved”

Shallowness of git fetching · Issue #9402 · NixOS/nix · GitHub

  • @regnat: Should it be part of the initial fetchTree stabilisation
    • :shrug:
  • DavHau said he’ll work on this, we can ping in January to confirm if nothing has happened

override ttl for some git fetchers by elikoga · Pull Request #8954 · NixOS/nix · GitHub

  • Using --refresh might be a better (less invasive) solution
  • or use a local repo and --override-input
  • Decision: close

nix eval: add --argstr and --arg support by elikoga · Pull Request #8992 · NixOS/nix · GitHub

  • Still something of a can of worms
  • --apply can already give that (more or less)
  • @tomberek:
    • Related: --apply should apply to more than just nix eval
  • In the current CLI model we might do --expr '{ lib, a, b }: lib.whatever a b' --arg-flakeref lib nixpkgs#lib --arg a flake:nixpkgs#hello b=nixpkgs#cowsay
    • --arg-expr --arg-flakeref --arg-str
  • Proposal, more ergonomic --apply '{ lib, a, b }: lib.whatever a b' lib=nixpkgs#lib a=nixpkgs#hello --arg-expr b 1
  • @tomberek: More powerful and concise than bundler. Could open new opportunities in ecosystem.
  • @roberth: Need a few examples to inform the syntax design
  • @roberth: Don’t care about the exact syntax. We need the more powerful semantics, and then have suitable syntax, so that users gravitate towards it.
  • nix build A#installable --apply nixpkgs#lib.id --apply nixpkgs#lib.id --apply nixpkgs#pkgsMuslTransofrm --apply nixpkgs#pkgsStaticTransform --apply bundlers#toDocker – apply bundlers#recompressBetter
    • gstreamer input ! toAvi ! filterA ! filterB ! output-format-G
    • gst-launch-1.0 filesrc location=music.mp3 ! mad ! audioconvert ! audioresample ! osssink

Idea: nix flake init --apply

Discussion after meeting

  • nix flake init --apply '{ lib, a }: lib.foo a' lib=nixpkgs#lib a=nixpkgs#hello
  • desugars to and writes out
    {
      inputs.nixpkgs.url = ...
      outputs = { nixpkgs, ... }:
      let
        lib = nixpkgs.lib;
        a = nixpkgs.legacyPackages.x86_64-linux.hello;
      in
      {
        it = ({ lib, a }: lib.foo a) { inherit lib a; };
        # or:
        it = lib.foo a;
      }
    }
    
  • -t should still work. Nix will invoke a template function that receives the expressions, installables etc as strings (and attrsets etc as necessary; structure data)
    • builtins.toTree rec {
        a = "data"
        b = "data";
        folder.a = "data";
      
        # crazy time...
        c = a; # symlink ?! # roberth: primops shouldn't make this distinction; "just data"
        ${a} = "other data";
      }
      
3 Likes