Merge #478
478: tasks.py: add update-terraform, terraform/flake.lock: Update r=Mic92 a=zowoq Co-authored-by: zowoq <59103226+zowoq@users.noreply.github.com>
This commit is contained in:
commit
66475fc83c
2 changed files with 22 additions and 3 deletions
19
tasks.py
19
tasks.py
|
@ -198,6 +198,25 @@ def scan_age_keys(c, host):
|
|||
)
|
||||
|
||||
|
||||
@task
|
||||
def update_terraform(c):
|
||||
"""
|
||||
Update terraform devshell flake
|
||||
"""
|
||||
with c.cd("terraform"):
|
||||
c.run(
|
||||
"""
|
||||
system="$(nix eval --impure --raw --expr 'builtins.currentSystem')"
|
||||
old="$(nix build --no-link --print-out-paths ".#devShells.${system}.default")"
|
||||
nix flake update --commit-lock-file
|
||||
new="$(nix build --no-link --print-out-paths ".#devShells.${system}.default")"
|
||||
commit="$(git log --pretty=format:%B -1)"
|
||||
diff="$(nix store diff-closures "${old}" "${new}" | awk -F ',' '/terraform/ && /→/ {print $1}')"
|
||||
git commit --amend -m "${commit}" -m "Terraform updates:" -m "${diff}"
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
@task
|
||||
def format_disks(c, hosts="", disks=""):
|
||||
"""
|
||||
|
|
6
terraform/flake.lock
generated
6
terraform/flake.lock
generated
|
@ -2,11 +2,11 @@
|
|||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1676795730,
|
||||
"narHash": "sha256-X69A9BdcPTySJJ7DqS4wc8b6eqGKi32jCSyaBsz4WB0=",
|
||||
"lastModified": 1678780369,
|
||||
"narHash": "sha256-D8wM0K1EkWLwbUu9fohC57+n89zC9qQ3hdC9Bys5GYw=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "efc59894b1ba73cb745676616c56c780383d6788",
|
||||
"rev": "1474943fd91fbe5567f7582acf568e0f999f4af1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
Loading…
Add table
Reference in a new issue