forked from hswaw/hscloud
ops/machines.nix: inject workspace
This makes the hscloud readTree object available as following in NixOS modules: { config, pkgs, workspace, ... }: { environment.systemPackages = [ workspace.hswaw.laserproxy ]; } Change-Id: I9c8146f5156ffe5d06cb8408a2ce632657990d59 Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1164 Reviewed-by: q3k <q3k@hackerspace.pl>master
parent
ae2886ba10
commit
a16af2db91
|
@ -69,9 +69,14 @@ let
|
||||||
];
|
];
|
||||||
})];
|
})];
|
||||||
|
|
||||||
# mkMachine builds NixOS modules into a NixOS derivation, and injects
|
# mkMachine builds NixOS modules into a NixOS derivation.
|
||||||
# passthru.hscloud.provision which deploys that configuration over SSH to a
|
# It:
|
||||||
# production machine.
|
# 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, ... }: {
|
mkMachine = pkgs: paths: pkgs.nixos ({ config, pkgs, ... }: {
|
||||||
imports = paths;
|
imports = paths;
|
||||||
|
|
||||||
|
@ -123,6 +128,9 @@ let
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
passthru.hscloud.provision = pkgs.writeScript "provision-${fqdn}" runProvision;
|
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 {
|
in {
|
||||||
|
|
Loading…
Reference in New Issue