refactor(builder): Parameterise CPU architecture to use for images

Adds the CPU architecture to the image configuration. This will make
it possible to let users toggle architecture via meta-packages.

Relates to #13
This commit is contained in:
Vincent Ambo 2019-11-05 12:57:10 +00:00 committed by Vincent Ambo
parent 7afbc912ce
commit 3c2de4c037
3 changed files with 33 additions and 6 deletions

View file

@ -25,6 +25,7 @@
# Description of the package set to be used (will be loaded by load-pkgs.nix)
srcType ? "nixpkgs",
srcArgs ? "nixos-19.03",
system ? "x86_64-linux",
importArgs ? { },
# Path to load-pkgs.nix
loadPkgs ? ./load-pkgs.nix,
@ -46,7 +47,12 @@ let
inherit (pkgs) lib runCommand writeText;
pkgs = import loadPkgs { inherit srcType srcArgs importArgs; };
pkgs = import loadPkgs {
inherit srcType srcArgs;
importArgs = importArgs // {
inherit system;
};
};
# deepFetch traverses the top-level Nix package set to retrieve an item via a
# path specified in string form.