add task to build nixos machines locally
this is also useful for people that do not have access to the servers (i.e. as part of a PR).
This commit is contained in:
parent
d57601e4cb
commit
c787d3dd4c
1 changed files with 23 additions and 0 deletions
23
tasks.py
23
tasks.py
|
@ -164,6 +164,29 @@ def deploy(c, hosts=""):
|
|||
deploy_nixos(get_hosts(hosts))
|
||||
|
||||
|
||||
@task
|
||||
def build_local(c, hosts=""):
|
||||
"""
|
||||
Build all servers. Use inv build-local --host build01 to build a single server
|
||||
"""
|
||||
g = DeployGroup(get_hosts(hosts))
|
||||
|
||||
def build_local(h: DeployHost) -> None:
|
||||
h.run_local(
|
||||
[
|
||||
"nixos-rebuild",
|
||||
"build",
|
||||
"--option",
|
||||
"accept-flake-config",
|
||||
"true",
|
||||
"--flake",
|
||||
f".#{h.host}",
|
||||
]
|
||||
)
|
||||
|
||||
g.run_function(build_local)
|
||||
|
||||
|
||||
def wait_for_port(host: str, port: int, shutdown: bool = False) -> None:
|
||||
import socket, time
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue