shells (artiq-fast): change artiqpkgs, vivado to arguments #76

Open
drewrisinger wants to merge 1 commits from drewrisinger/nix-scripts:feature/shell-artiqpkgs-args into master

This allows overriding the artiqpkgs used downstream.
The issue is that previously artiqpkgs required <artiqSrc> to be defined,
and overriding that required setting paths, added complexity, and possible impurities.

This solution allows reuse of the shell[-dev], from a given version of
ARTIQ, without necessarily specifying source or a local source repo.

Example using previous override (which still required <artiqSrc> to be set):

{pkgs ? import <nixpkgs> { }
, artiqpkgs ? import <artiq-full> { }
}:
let
 mlabs-nix-scripts = builtins.fetchGit {
    url="https://git.m-labs.hk/M-Labs/nix-scripts.git";
    ref="master"; # impure, but fine for our purposes
  };
  dev-artiq-shell = import "${mlabs-nix-scripts}/artiq-fast/shell-dev.nix" {};  # Depends on <artiqSrc> to import, can't remove artiqSrc dependency easily
  # Force shell to use Release (i.e. MLabs Nix Channel) ARTIQ build, instead of passing all source/arguments ourselves.
  dev-shell-with-release-artiq = dev-artiq-shell.overrideAttrs (oldAttrs: rec { artiqpkgs = artiqpkgs ; });
in
  ...

New example (tested):

{ pkgs ? import <nixpkgs> { }
, artiqpkgs ? import <artiq-full> { }
}:
let
  mlabs-nix-scripts = ...; # this PR
  # Force shell to use Release (i.e. MLabs Nix Channel) ARTIQ build, instead of passing all source/arguments ourselves.
  dev-artiq-shell = import "${mlabs-nix-scripts}/artiq-fast/shell-dev.nix" { inherit artiqpkgs; };
in
  ...
This allows overriding the artiqpkgs used downstream. The issue is that previously artiqpkgs required ``<artiqSrc>`` to be defined, and overriding that required setting paths, added complexity, and possible impurities. This solution allows reuse of the shell[-dev], from a given version of ARTIQ, without necessarily specifying source or a local source repo. Example using previous override (which still required ``<artiqSrc>`` to be set): ```nix {pkgs ? import <nixpkgs> { } , artiqpkgs ? import <artiq-full> { } }: let mlabs-nix-scripts = builtins.fetchGit { url="https://git.m-labs.hk/M-Labs/nix-scripts.git"; ref="master"; # impure, but fine for our purposes }; dev-artiq-shell = import "${mlabs-nix-scripts}/artiq-fast/shell-dev.nix" {}; # Depends on <artiqSrc> to import, can't remove artiqSrc dependency easily # Force shell to use Release (i.e. MLabs Nix Channel) ARTIQ build, instead of passing all source/arguments ourselves. dev-shell-with-release-artiq = dev-artiq-shell.overrideAttrs (oldAttrs: rec { artiqpkgs = artiqpkgs ; }); in ... ``` New example (tested): ```nix { pkgs ? import <nixpkgs> { } , artiqpkgs ? import <artiq-full> { } }: let mlabs-nix-scripts = ...; # this PR # Force shell to use Release (i.e. MLabs Nix Channel) ARTIQ build, instead of passing all source/arguments ourselves. dev-artiq-shell = import "${mlabs-nix-scripts}/artiq-fast/shell-dev.nix" { inherit artiqpkgs; }; in ... ```
drewrisinger added 1 commit 2022-01-10 22:33:25 +08:00
47960f539b shells (artiq-fast): change artiqpkgs, vivado to arguments
This allows overriding the artiqpkgs used downstream.
The issue is that previously artiqpkgs required <artiqSrc> to be defined,
and overriding that required setting paths, added complexity, and possible impurities.

This solution allows reuse of the shell[-dev], from a given version of
ARTIQ, without necessarily specifying source or a local source repo.

Nix flakes (in 7) should provide a better solution to these problems.

Nix flakes (in 7) should provide a better solution to these problems.

Fair, but any objection to merging this anyways? It's an improvement to the stable (current) release.

Fair, but any objection to merging this anyways? It's an improvement to the stable (current) release.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b drewrisinger-feature/shell-artiqpkgs-args master
git pull feature/shell-artiqpkgs-args

Step 2:

Merge the changes and update on Gitea.
git checkout master
git merge --no-ff drewrisinger-feature/shell-artiqpkgs-args
git push origin master
Sign in to join this conversation.
No reviewers
No Label
No Milestone
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/nix-scripts#76
There is no content yet.