mirror of
https://cgit.krebsco.de/krops
synced 2024-11-23 11:39:48 +01:00
krops: add remoteCommand, use in build & rebuild
This commit is contained in:
parent
6d1c35ea2c
commit
3d59510ac2
1 changed files with 14 additions and 20 deletions
|
@ -5,6 +5,19 @@ in
|
||||||
{ exec, nix, openssh, populate, writeDash }: rec {
|
{ exec, nix, openssh, populate, writeDash }: rec {
|
||||||
|
|
||||||
build = target:
|
build = target:
|
||||||
|
remoteCommand target (lib.concatStringsSep " " [
|
||||||
|
"nix build"
|
||||||
|
"-I ${lib.escapeShellArg target.path}"
|
||||||
|
"--no-link -f '<nixpkgs/nixos>'"
|
||||||
|
"config.system.build.toplevel"
|
||||||
|
]);
|
||||||
|
|
||||||
|
rebuild = args: target:
|
||||||
|
remoteCommand target "nixos-rebuild -I ${lib.escapeShellArg target.path} ${
|
||||||
|
lib.concatMapStringsSep " " lib.escapeShellArg args
|
||||||
|
}";
|
||||||
|
|
||||||
|
remoteCommand = target: command:
|
||||||
exec "build.${target.host}" rec {
|
exec "build.${target.host}" rec {
|
||||||
filename = "${openssh}/bin/ssh";
|
filename = "${openssh}/bin/ssh";
|
||||||
argv = [
|
argv = [
|
||||||
|
@ -13,26 +26,7 @@ in
|
||||||
"-p" target.port
|
"-p" target.port
|
||||||
"-t"
|
"-t"
|
||||||
target.host
|
target.host
|
||||||
(lib.concatStringsSep " " [
|
command
|
||||||
"nix build"
|
|
||||||
"-I ${lib.escapeShellArg target.path}"
|
|
||||||
"--no-link -f '<nixpkgs/nixos>'"
|
|
||||||
"config.system.build.toplevel"
|
|
||||||
])
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
rebuild = args: target:
|
|
||||||
exec "rebuild.${target.host}" rec {
|
|
||||||
filename = "${openssh}/bin/ssh";
|
|
||||||
argv = [
|
|
||||||
filename
|
|
||||||
"-l" target.user
|
|
||||||
"-p" target.port
|
|
||||||
target.host
|
|
||||||
"nixos-rebuild -I ${lib.escapeShellArg target.path} ${
|
|
||||||
lib.concatMapStringsSep " " lib.escapeShellArg args
|
|
||||||
}"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue