Explicit inputs instead of nested follows #5

Open
opened 2022-12-21 05:30:01 +08:00 by bradbqc · 2 comments

Since nix evaluates the follows directives relative to the root flake, DAX is now causing problems for users following the ARTIQ installation instructions. I think the most straightforward fix is to inclue DAX's follows as flake inputs here:

  inputs.nixpkgs.follows = "artiq/nixpkgs";
  inputs.sipyco.follows = "artiq/sipyco";
  inputs.daxpkgs = {
    url = git+https://gitlab.com/duke-artiq/dax.git;
    inputs = {
      artiqpkgs.follows = "artiq";
      nixpkgs.follows = "nixpkgs";
      sipyco.follows = "sipyco";
    };
  };
  
  outputs = { self, artiq, daxpkgs, nixpkgs, sipyco }:
    let
      pkgs = import nixpkgs { system = "x86_64-linux"; };

and then the corresponding nixpkgs and sipyco follows in the example flake in the ARTIQ docs, which conveniently avoids any explicit mention of DAX.

Since nix evaluates the `follows` directives relative to the root flake, DAX is now causing [problems](https://forum.m-labs.hk/d/537-trouble-setting-up-artiq-via-nix-flakes) for users following the ARTIQ installation instructions. I think the most straightforward fix is to inclue DAX's `follows` as flake inputs here: ```nix inputs.nixpkgs.follows = "artiq/nixpkgs"; inputs.sipyco.follows = "artiq/sipyco"; inputs.daxpkgs = { url = git+https://gitlab.com/duke-artiq/dax.git; inputs = { artiqpkgs.follows = "artiq"; nixpkgs.follows = "nixpkgs"; sipyco.follows = "sipyco"; }; }; outputs = { self, artiq, daxpkgs, nixpkgs, sipyco }: let pkgs = import nixpkgs { system = "x86_64-linux"; }; ``` and then the corresponding `nixpkgs` and `sipyco` follows in the example flake in the ARTIQ docs, which conveniently avoids any explicit mention of DAX.

Since nix evaluates the follows directives relative to the root flake

Are you running recent Nix (2.8+)? They fixed a bunch of problems with flake follows in recent versions, which may or may not improve things here.

> Since nix evaluates the follows directives relative to the root flake Are you running recent Nix (2.8+)? They fixed a bunch of problems with flake follows in recent versions, which may or may not improve things here.

I'm on 2.11.0 - looks like we're stuck with this behavior

AFAICT it's intentional for whatever reason -- from the flake section of the nix manual:

The value of the follows attribute is a /-separated sequence of input names denoting the path of inputs to be followed from the root flake.

I'm on 2.11.0 - looks like we're stuck with this behavior AFAICT it's intentional for whatever reason -- from the flake section of the nix manual: > The value of the follows attribute is a /-separated sequence of input names denoting the path of inputs to be followed from the root flake.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/artiq-extrapkg#5
There is no content yet.