From 73e1cf8bf9caa8b6875c91e7c08331c7bd2d66b4 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Mon, 11 Dec 2023 13:33:38 +1000 Subject: [PATCH] unpin terraform shell --- flake.lock | 17 ----------------- flake.nix | 2 -- tasks.py | 21 --------------------- terraform/shell.nix | 7 +++---- 4 files changed, 3 insertions(+), 44 deletions(-) diff --git a/flake.lock b/flake.lock index cddc27f..441b53b 100644 --- a/flake.lock +++ b/flake.lock @@ -238,7 +238,6 @@ "nur-update": "nur-update", "sops-nix": "sops-nix", "srvos": "srvos", - "tf-pkgs": "tf-pkgs", "treefmt-nix": "treefmt-nix" } }, @@ -284,22 +283,6 @@ "type": "github" } }, - "tf-pkgs": { - "locked": { - "lastModified": 1697343899, - "narHash": "sha256-66Dosy7YYVhkesbHXB4xxZZ+2NOi9CmFDyHOI1ZTAbQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "982b24c40e743793c966b47b3bb3699881489ae0", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "982b24c40e743793c966b47b3bb3699881489ae0", - "type": "github" - } - }, "treefmt-nix": { "inputs": { "nixpkgs": [ diff --git a/flake.nix b/flake.nix index 085ddb9..6c99c13 100644 --- a/flake.nix +++ b/flake.nix @@ -41,8 +41,6 @@ treefmt-nix.url = "github:numtide/treefmt-nix"; treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; - tf-pkgs.url = "github:NixOS/nixpkgs/982b24c40e743793c966b47b3bb3699881489ae0"; - hercules-ci-agent.url = "github:hercules-ci/hercules-ci-agent"; hercules-ci-agent.inputs.flake-parts.follows = "flake-parts"; #hercules-ci-agent.inputs.nixpkgs.follows = "nixpkgs"; diff --git a/tasks.py b/tasks.py index 412dc34..91b0b40 100644 --- a/tasks.py +++ b/tasks.py @@ -89,27 +89,6 @@ def print_keys(c: Any, flake_attr: str) -> None: ) -@task -def update_terraform(c: Any) -> None: - """ - Update terraform devshell flake - """ - c.run( - """ -system="$(nix eval --impure --raw --expr 'builtins.currentSystem')" -oldShell="$(nix build --no-link --print-out-paths ".#devShells.${system}.terraform")" -oldRev="$(nix flake metadata --json | jq -r '.locks.nodes."tf-pkgs".locked.rev')" -newRev="$(nix flake metadata --json | jq -r '.locks.nodes.nixpkgs.locked.rev')" -sed -i "s|${oldRev}|${newRev}|" flake.nix -nix flake lock --update-input tf-pkgs --commit-lock-file -newShell="$(nix build --no-link --print-out-paths ".#devShells.${system}.terraform")" -commit="$(git log --pretty=format:%B -1)" -diff="$(nix store diff-closures "${oldShell}" "${newShell}" | awk -F ',' '/terraform/ && /→/ {print $1}')" -git commit --all --amend -m "${commit}" -m "Terraform updates:" -m "${diff}" -""" - ) - - @task def mkdocs(c: Any) -> None: """ diff --git a/terraform/shell.nix b/terraform/shell.nix index 04ed5bd..7e7f964 100644 --- a/terraform/shell.nix +++ b/terraform/shell.nix @@ -1,11 +1,10 @@ -{ inputs', ... }: +{ pkgs, ... }: let - tf-pkgs = inputs'.tf-pkgs.legacyPackages; - terraform' = tf-pkgs.terraform.overrideAttrs (_: { meta = { }; }); + terraform' = pkgs.terraform.overrideAttrs (_: { meta = { }; }); in { devShells = { - terraform = with tf-pkgs; mkShellNoCC { + terraform = with pkgs; mkShellNoCC { packages = [ (terraform'.withPlugins (p: [ p.cloudflare