|
59 | 59 |
|
60 | 60 | # Create parent directory if it does not exist |
61 | 61 | '' |
62 | | - ssh {{.REMOTE_USER}}@{{.REMOTE_HOST}} 'umask 076; sudo -u ${user} mkdir -p "$(dirname ${pkgs.lib.escapeShellArg secretConfig.path})"' |
| 62 | + {{.REMOTE_COMMAND}} {{.REMOTE_SSH_OPTS}} {{.REMOTE_USER}}@{{.REMOTE_HOST}} 'umask 076; sudo -u ${user} mkdir -p "$(dirname ${pkgs.lib.escapeShellArg secretConfig.path})"' |
63 | 63 | '' |
64 | 64 | # Copy file |
65 | 65 | '' |
66 | | - ${secretConfig.cmd} | ssh {{.REMOTE_USER}}@{{.REMOTE_HOST}} "umask 077; cat > ${pkgs.lib.escapeShellArg secretConfig.path}" |
| 66 | + ${secretConfig.cmd} | {{.REMOTE_COMMAND}} {{.REMOTE_SSH_OPTS}} {{.REMOTE_USER}}@{{.REMOTE_HOST}} "umask 077; cat > ${pkgs.lib.escapeShellArg secretConfig.path}" |
67 | 67 | '' |
68 | 68 | # # Set group and owner |
69 | 69 | '' |
70 | | - ssh {{.REMOTE_USER}}@{{.REMOTE_HOST}} "chown ${secretConfig.owner}:${secretConfig.group-name} ${pkgs.lib.escapeShellArg secretConfig.path}" |
| 70 | + {{.REMOTE_COMMAND}} {{.REMOTE_SSH_OPTS}} {{.REMOTE_USER}}@{{.REMOTE_HOST}} "chown ${secretConfig.owner}:${secretConfig.group-name} ${pkgs.lib.escapeShellArg secretConfig.path}" |
71 | 71 | '' |
72 | 72 | ]) |
73 | 73 | userconfig.lollypops.secrets.files)) |
|
130 | 130 |
|
131 | 131 | # Create parent directory if it does not exist |
132 | 132 | '' |
133 | | - {{.REMOTE_COMMAND}} {{.REMOTE_OPTS}} {{.REMOTE_USER}}@{{.REMOTE_HOST}} \ |
| 133 | + {{.REMOTE_COMMAND}} {{.REMOTE_SSH_OPTS}} {{.REMOTE_USER}}@{{.REMOTE_HOST}} \ |
134 | 134 | 'umask 076; ${optionalString useSudo "{{.REMOTE_SUDO_COMMAND}} {{.REMOTE_SUDO_OPTS}} "} mkdir -p "$(dirname ${path})"' |
135 | 135 | '' |
136 | 136 |
|
137 | 137 | # Copy file |
138 | 138 | '' |
139 | | - ${x.cmd} | {{.REMOTE_COMMAND}} {{.REMOTE_OPTS}} {{.REMOTE_USER}}@{{.REMOTE_HOST}} \ |
| 139 | + ${x.cmd} | {{.REMOTE_COMMAND}} {{.REMOTE_SSH_OPTS}} {{.REMOTE_USER}}@{{.REMOTE_HOST}} \ |
140 | 140 | "${optionalString useSudo "{{.REMOTE_SUDO_COMMAND}} {{.REMOTE_SUDO_OPTS}}"} \ |
141 | 141 | install -m 700 /dev/null ${path}; \ |
142 | 142 | ${optionalString useSudo "{{.REMOTE_SUDO_COMMAND}} {{.REMOTE_SUDO_OPTS}}"} \ |
|
145 | 145 |
|
146 | 146 | # Set group and owner |
147 | 147 | '' |
148 | | - {{.REMOTE_COMMAND}} {{.REMOTE_OPTS}} {{.REMOTE_USER}}@{{.REMOTE_HOST}} \ |
| 148 | + {{.REMOTE_COMMAND}} {{.REMOTE_SSH_OPTS}} {{.REMOTE_USER}}@{{.REMOTE_HOST}} \ |
149 | 149 | "${optionalString useSudo "{{.REMOTE_SUDO_COMMAND}} {{.REMOTE_SUDO_OPTS}}"} \ |
150 | 150 | chown ${x.owner}:${x.group-name} ${path}" |
151 | 151 | '' |
|
186 | 186 | --target-host {{.REMOTE_USER}}@{{.REMOTE_HOST}} \ |
187 | 187 | ${optionalString useSudo "--use-remote-sudo"} |
188 | 188 | '' else '' |
189 | | - {{.REMOTE_COMMAND}} {{.REMOTE_OPTS}} {{.REMOTE_USER}}@{{.REMOTE_HOST}} \ |
| 189 | + {{.REMOTE_COMMAND}} {{.REMOTE_SSH_OPTS}} {{.REMOTE_USER}}@{{.REMOTE_HOST}} \ |
190 | 190 | "${optionalString useSudo "{{.REMOTE_SUDO_COMMAND}} {{.REMOTE_SUDO_OPTS}}"} nixos-rebuild {{.REBUILD_ACTION}} \ |
191 | 191 | --flake '{{.REMOTE_CONFIG_DIR}}#{{.HOSTNAME}}'" |
192 | 192 | '') |
|
206 | 206 | fi |
207 | 207 | ${pkgs.rsync}/bin/rsync \ |
208 | 208 | --verbose \ |
209 | | - -e {{.REMOTE_COMMAND}}\ -l\ {{.REMOTE_USER}}\ -T \ |
| 209 | + -e "{{.REMOTE_COMMAND}} -l {{.REMOTE_USER}} -T {{.REMOTE_SSH_OPTS}}" \ |
210 | 210 | -FD \ |
211 | 211 | --checksum \ |
212 | 212 | --times \ |
|
0 commit comments