mirror of https://cgit.krebsco.de/krops/
writeDeploy: fancy output with nix build
This commit is contained in:
parent
219e5aa008
commit
ee41207df1
|
@ -4,6 +4,24 @@ in
|
||||||
|
|
||||||
{ exec, nix, openssh, populate, writeDash }: rec {
|
{ exec, nix, openssh, populate, writeDash }: rec {
|
||||||
|
|
||||||
|
build = target:
|
||||||
|
exec "rebuild.${target.host}" rec {
|
||||||
|
filename = "${openssh}/bin/ssh";
|
||||||
|
argv = [
|
||||||
|
filename
|
||||||
|
"-l" target.user
|
||||||
|
"-p" target.port
|
||||||
|
"-t"
|
||||||
|
target.host
|
||||||
|
(lib.concatStringsSep " " [
|
||||||
|
"nix build"
|
||||||
|
"-I ${lib.escapeShellArg target.path}"
|
||||||
|
"--no-link -f '<nixpkgs/nixos>'"
|
||||||
|
"config.system.build.toplevel"
|
||||||
|
])
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
rebuild = args: target:
|
rebuild = args: target:
|
||||||
exec "rebuild.${target.host}" rec {
|
exec "rebuild.${target.host}" rec {
|
||||||
filename = "${openssh}/bin/ssh";
|
filename = "${openssh}/bin/ssh";
|
||||||
|
@ -24,6 +42,7 @@ in
|
||||||
writeDash name ''
|
writeDash name ''
|
||||||
set -efu
|
set -efu
|
||||||
${populate { inherit force source; target = target'; }}
|
${populate { inherit force source; target = target'; }}
|
||||||
|
${build target'}
|
||||||
${rebuild ["switch"] target'}
|
${rebuild ["switch"] target'}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue