diff --git a/deploy.nix b/deploy.nix index 6c07e8e..bc4f712 100644 --- a/deploy.nix +++ b/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) diff --git a/machines/default.nix b/machines/default.nix new file mode 100644 index 0000000..3184a3f --- /dev/null +++ b/machines/default.nix @@ -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 = { }; +}