diff --git a/ops/machines.nix b/ops/machines.nix index 9a54c56c..d0e6ae3c 100644 --- a/ops/machines.nix +++ b/ops/machines.nix @@ -69,9 +69,14 @@ let ]; })]; - # mkMachine builds NixOS modules into a NixOS derivation, and injects - # passthru.hscloud.provision which deploys that configuration over SSH to a - # production machine. + # mkMachine builds NixOS modules into a NixOS derivation. + # It: + # 1) injects passthru.hscloud.provision which deploys that configuration + # over SSH to a production machine. + # 2) injects 'workspace' as a nixos module argument which points to the root + # of the hscloud readTree object. It will contain whatever nixpkgs + # checkout this file has been invoked with, ie. will not be 'mixed in' + # with the pkgs argument. mkMachine = pkgs: paths: pkgs.nixos ({ config, pkgs, ... }: { imports = paths; @@ -123,6 +128,9 @@ let ''; in { 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; }; }); in {