add phone alias to nh
This commit is contained in:
parent
6c22579e6f
commit
2c4fb39aa1
1 changed files with 10 additions and 5 deletions
|
|
@ -16,15 +16,20 @@ in
|
|||
|
||||
system.tools.nixos-rebuild.enable = false;
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellScriptBin "server" ''
|
||||
# e.g. `server rebuild` or `phone boot`: the aliases, for another host over SSH
|
||||
environment.systemPackages = lib.mapAttrsToList (
|
||||
command: host:
|
||||
pkgs.writeShellScriptBin command ''
|
||||
${lib.concatMapAttrsStringSep "\n" (
|
||||
name: cmd: ''${name}() { ${cmd} -H quadraticserver --target-host server --diff never "$@"; }''
|
||||
name: cmd: ''${name}() { ${cmd} -H ${host} --target-host ${command} --diff never "$@"; }''
|
||||
) aliases}
|
||||
|
||||
"$@"
|
||||
'')
|
||||
];
|
||||
''
|
||||
) {
|
||||
server = "quadraticserver";
|
||||
phone = "quadphone";
|
||||
};
|
||||
|
||||
environment.shellAliases = aliases // {
|
||||
clean = "nh clean all";
|
||||
|
|
|
|||
Loading…
Reference in a new issue