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
|
||||
kropsPkgs.krops.writeDeploy "deploy-${hostname}" {
|
||||
source = source;
|
||||
target = lib.mkTarget (if target == null then "root@${hostname}" else target) // {
|
||||
target = lib.mkTarget target // {
|
||||
extraOptions = [
|
||||
# force allocation of tty to allow aborting with ^C and to show build progress
|
||||
"-t"
|
||||
|
@ -53,8 +53,6 @@ let
|
|||
};
|
||||
};
|
||||
in
|
||||
builtins.mapAttrs (hostname: configuration: kropsDeploy ({ inherit hostname; } // configuration))
|
||||
{
|
||||
nunotaba = { };
|
||||
sayuri = { };
|
||||
}
|
||||
builtins.mapAttrs
|
||||
(hostname: configuration: kropsDeploy ({ inherit hostname; } // configuration))
|
||||
(import ./machines)
|
||||
|
|
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