From c35ea6a220d937d0d230dc2cf0c80d850e23e0f0 Mon Sep 17 00:00:00 2001 From: Serge Bazanski Date: Thu, 7 Jul 2022 17:47:58 +0200 Subject: [PATCH] ops: inject the machine's pkgs into the machine's hscloud tree This ensures, for example, that the packets are for the correct architecture. Change-Id: If17c307fbad02ee72c6dd21a874c59514415ab2e Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1334 Reviewed-by: implr --- default.nix | 17 ++++++++++------- ops/machines.nix | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/default.nix b/default.nix index f06a4d3b..d3eb8696 100644 --- a/default.nix +++ b/default.nix @@ -18,12 +18,15 @@ let config.allowBroken = true; }; -in fix (self: (readTree rec { - hscloud = self; - pkgs = nixpkgs; - pkgsSrc = nixpkgsSrc; - inherit (nixpkgs) lib stdenv; -} ./.) // { + resForPkgs = pkgs: fix (self: (readTree rec { + hscloud = self; + inherit pkgs; + pkgsSrc = pkgs.path; + inherit (pkgs) lib stdenv; + hscloudForPkgs = pkgs: resForPkgs pkgs; + } ./.)); + +in (resForPkgs nixpkgs) // { root = ./.; pkgs = nixpkgs; -}) +} diff --git a/ops/machines.nix b/ops/machines.nix index 6a955734..5d09d743 100644 --- a/ops/machines.nix +++ b/ops/machines.nix @@ -5,7 +5,7 @@ # # For information about building/deploying machines see //ops/README.md. -{ hscloud, pkgs, ... }: +{ hscloud, pkgs, hscloudForPkgs, ... }: let # nixpkgs for cluster machines (.hswaw.net). Currently pinned to an old @@ -121,7 +121,7 @@ let passthru.hscloud.provision = pkgs.writeScript "provision-${fqdn}" runProvision; # TODO(q3k): this should be named hscloud, but that seems to not work. Debug and rename. - _module.args.workspace = hscloud; + _module.args.workspace = hscloudForPkgs pkgs; _module.args.machines = machines; }; });