mirror of
https://cgit.krebsco.de/krops
synced 2024-11-26 21:19:47 +01:00
pkgs.krops: add rebuild
This commit is contained in:
parent
c46166d407
commit
5cd8bd046e
1 changed files with 14 additions and 4 deletions
|
@ -2,7 +2,19 @@ let
|
||||||
lib = import ../../lib;
|
lib = import ../../lib;
|
||||||
in
|
in
|
||||||
|
|
||||||
{ nix, openssh, populate, writeDash, writeJSON }: {
|
{ exec, nix, openssh, populate, writeDash, writeJSON }: rec {
|
||||||
|
|
||||||
|
rebuild = target:
|
||||||
|
exec "rebuild.${target.host}" rec {
|
||||||
|
filename = "${openssh}/bin/ssh";
|
||||||
|
argv = [
|
||||||
|
filename
|
||||||
|
"-l" target.user
|
||||||
|
"-p" target.port
|
||||||
|
target.host
|
||||||
|
"nixos-rebuild switch -I ${lib.escapeShellArg target.path}"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
writeDeploy = name: { source, target }: let
|
writeDeploy = name: { source, target }: let
|
||||||
target' = lib.mkTarget target;
|
target' = lib.mkTarget target;
|
||||||
|
@ -10,9 +22,7 @@ in
|
||||||
writeDash name ''
|
writeDash name ''
|
||||||
set -efu
|
set -efu
|
||||||
${populate { inherit source; target = target'; }}
|
${populate { inherit source; target = target'; }}
|
||||||
${openssh}/bin/ssh \
|
${rebuild target'}
|
||||||
${target'.user}@${target'.host} -p ${target'.port} \
|
|
||||||
nixos-rebuild switch -I ${target'.path}
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
writeTest = name: { source, target }: let
|
writeTest = name: { source, target }: let
|
||||||
|
|
Loading…
Reference in a new issue