flake: expose build, allow selection of output #191

Merged
sb10q merged 2 commits from mwojcik/artiq-zynq:flake_expose_build into master 2022-05-26 12:29:51 +08:00
Owner

This will be necessary for zynq support in afws - first exposing the build function in the first place, secondly - allowing to specify the desired output instead of building everything (e.g. only sd).

tested in terminal with nix build -L --impure --expr 'let fl = builtins.getFlake "git+file:///home/spaqin/m-labs/artiq-zynq"; in fl.makeArtiqZynqPackage {target="zc706"; variant="nist_clock"; output="sd";}' (kasli_soc json won't load? probably would have to specify nix sandbox whitelist) - and yes it builds only one.

This will be necessary for zynq support in afws - first exposing the build function in the first place, secondly - allowing to specify the desired output instead of building everything (e.g. only ``sd``). tested in terminal with ``nix build -L --impure --expr 'let fl = builtins.getFlake "git+file:///home/spaqin/m-labs/artiq-zynq"; in fl.makeArtiqZynqPackage {target="zc706"; variant="nist_clock"; output="sd";}'`` (kasli_soc json won't load? probably would have to specify nix sandbox whitelist) - and yes it builds only one.
mwojcik added 1 commit 2022-05-26 11:57:06 +08:00
Owner

probably would have to specify nix sandbox whitelist

No, just follow what non-Zynq is doing.

> probably would have to specify nix sandbox whitelist No, just follow what non-Zynq is doing.
sb10q reviewed 2022-05-26 12:04:07 +08:00
flake.nix Outdated
@ -124,2 +124,3 @@
];
build = { target, variant, json ? null }: let
build = { target, variant, json ? null, output ? null }: let
# output - if null will build everything (fw, gw, jtag, sd) or can be specified to build only one
Owner

This is getting messy and there is already a standard Nix feature to do this: attributes. Refactoring needed?

This is getting messy and there is already a standard Nix feature to do this: attributes. Refactoring needed?
mwojcik added 1 commit 2022-05-26 12:14:00 +08:00
Author
Owner

Okay, yep I got it for both json (forgot path in Nix is a separate type) and the attributes. All good, just need to expose the function.

Okay, yep I got it for both json (forgot path in Nix is a separate type) and the attributes. All good, just need to expose the function.
sb10q merged commit dce8c974eb into master 2022-05-26 12:29:51 +08:00
Sign in to join this conversation.
No reviewers
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/artiq-zynq#191
No description provided.