Decouple machine configuration and deployment
This allows custom scripts to access machine-specific variables.
This commit is contained in:
parent
204962d0f3
commit
e7c6406820
10
deploy.nix
10
deploy.nix
|
@ -45,7 +45,7 @@ let
|
||||||
in
|
in
|
||||||
kropsPkgs.krops.writeDeploy "deploy-${hostname}" {
|
kropsPkgs.krops.writeDeploy "deploy-${hostname}" {
|
||||||
source = source;
|
source = source;
|
||||||
target = lib.mkTarget (if target == null then "root@${hostname}" else target) // {
|
target = lib.mkTarget target // {
|
||||||
extraOptions = [
|
extraOptions = [
|
||||||
# force allocation of tty to allow aborting with ^C and to show build progress
|
# force allocation of tty to allow aborting with ^C and to show build progress
|
||||||
"-t"
|
"-t"
|
||||||
|
@ -53,8 +53,6 @@ let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
builtins.mapAttrs (hostname: configuration: kropsDeploy ({ inherit hostname; } // configuration))
|
builtins.mapAttrs
|
||||||
{
|
(hostname: configuration: kropsDeploy ({ inherit hostname; } // configuration))
|
||||||
nunotaba = { };
|
(import ./machines)
|
||||||
sayuri = { };
|
|
||||||
}
|
|
||||||
|
|
18
machines/default.nix
Normal file
18
machines/default.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
let
|
||||||
|
sources = import ../nix/sources.nix;
|
||||||
|
|
||||||
|
pkgs = import sources.nixpkgs { };
|
||||||
|
lib = pkgs.lib;
|
||||||
|
in
|
||||||
|
lib.mapAttrs
|
||||||
|
(hostname: options: {
|
||||||
|
inherit hostname;
|
||||||
|
target =
|
||||||
|
if lib.hasAttr "target" options
|
||||||
|
then options.target
|
||||||
|
else "root@${hostname}";
|
||||||
|
})
|
||||||
|
{
|
||||||
|
nunotaba = { };
|
||||||
|
sayuri = { };
|
||||||
|
}
|
Loading…
Reference in a new issue