simplify via inherit
This commit is contained in:
parent
dc38740129
commit
0fe6007716
1 changed files with 27 additions and 14 deletions
|
|
@ -46,36 +46,49 @@
|
||||||
);
|
);
|
||||||
|
|
||||||
deploy.nodes = mapNodes (nodeName: node: let
|
deploy.nodes = mapNodes (nodeName: node: let
|
||||||
|
inherit
|
||||||
|
(node.deploy)
|
||||||
|
activationTimeout
|
||||||
|
autoRollback
|
||||||
|
confirmTimeout
|
||||||
|
interactiveSudo
|
||||||
|
magicRollback
|
||||||
|
remoteBuild
|
||||||
|
ssh
|
||||||
|
sudo
|
||||||
|
user
|
||||||
|
;
|
||||||
|
|
||||||
nixosFor = system: deploy-rs.lib.${system}.activate.nixos;
|
nixosFor = system: deploy-rs.lib.${system}.activate.nixos;
|
||||||
in {
|
in {
|
||||||
hostname = node.deploy.ssh.host;
|
hostname = ssh.host;
|
||||||
|
|
||||||
profilesOrder = ["default"]; # profiles priority
|
profilesOrder = ["default"]; # profiles priority
|
||||||
profiles.default = {
|
profiles.default = {
|
||||||
path = nixosFor node.system nixosConfigurations.${nodeName};
|
path = nixosFor node.system nixosConfigurations.${nodeName};
|
||||||
|
|
||||||
user = node.deploy.user;
|
user = user;
|
||||||
sudo = node.deploy.sudo;
|
sudo = sudo;
|
||||||
interactiveSudo = node.deploy.interactiveSudo;
|
interactiveSudo = interactiveSudo;
|
||||||
|
|
||||||
fastConnection = false;
|
fastConnection = false;
|
||||||
|
|
||||||
autoRollback = node.deploy.autoRollback;
|
autoRollback = autoRollback;
|
||||||
magicRollback = node.deploy.magicRollback;
|
magicRollback = magicRollback;
|
||||||
activationTimeout = node.deploy.activationTimeout;
|
activationTimeout = activationTimeout;
|
||||||
confirmTimeout = node.deploy.confirmTimeout;
|
confirmTimeout = confirmTimeout;
|
||||||
|
|
||||||
remoteBuild = node.deploy.remoteBuild;
|
remoteBuild = remoteBuild;
|
||||||
sshUser = node.deploy.ssh.user;
|
sshUser = ssh.user;
|
||||||
sshOpts =
|
sshOpts =
|
||||||
node.deploy.ssh.opts
|
ssh.opts
|
||||||
++ (
|
++ (
|
||||||
if builtins.elem "-p" node.deploy.ssh.opts
|
if builtins.elem "-p" ssh.opts
|
||||||
then []
|
then []
|
||||||
else ["-p" (toString node.deploy.ssh.port)]
|
else ["-p" (toString ssh.port)]
|
||||||
)
|
)
|
||||||
++ (
|
++ (
|
||||||
if builtins.elem "-A" node.deploy.ssh.opts
|
if builtins.elem "-A" ssh.opts
|
||||||
then []
|
then []
|
||||||
else ["-A"]
|
else ["-A"]
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue