about summary refs log tree commit diff
path: root/tools/nixery/build-image/default.nix
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-09-08T20·53+0100
committerVincent Ambo <github@tazj.in>2019-09-10T10·32+0100
commit980f5e218761fa340b746e6336db62abf63c953a (patch)
tree3c5d2b31b214b0bf6cc511a6dbb1b11102d8c213 /tools/nixery/build-image/default.nix
parent496a4ab84742279fb7bbd1c8ac9d4ebd1a44b148 (diff)
refactor(server): Move package source management logic to server
Introduces three new types representing each of the possible package
sources and moves the logic for specifying the package source to the
server.

Concrete changes:

* Determining whether a specified git reference is a commit vs. a
  branch/tag is now done in the server, and is done more precisely by
  using a regular expression.

* Package sources now have a new `CacheKey` function which can be used
  to retrieve a key under which a build manifest can be cached *if*
  the package source is not a moving target (i.e. a full git commit
  hash of either nixpkgs or a private repository).

  This function is not yet used.

* Users *must* now specify a package source, Nixery no longer defaults
  to anything and will fail to launch if no source is configured.
Diffstat (limited to 'tools/nixery/build-image/default.nix')
-rw-r--r--tools/nixery/build-image/default.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/nixery/build-image/default.nix b/tools/nixery/build-image/default.nix
index 0d3002cb404e..6b1cea6f0ca2 100644
--- a/tools/nixery/build-image/default.nix
+++ b/tools/nixery/build-image/default.nix
@@ -20,11 +20,12 @@
 
   # Because of the insanity occuring below, this function must mirror
   # all arguments of build-image.nix.
-, pkgSource ? "nixpkgs!nixos-19.03"
+, srcType ? "nixpkgs"
+, srcArgs ? "nixos-19.03"
 , tag ? null, name ? null, packages ? null, maxLayers ? null
 }@args:
 
-let pkgs = import ./load-pkgs.nix { inherit pkgSource; };
+let pkgs = import ./load-pkgs.nix { inherit srcType srcArgs; };
 in with pkgs; rec {
 
   groupLayers = buildGoPackage {