unpin terraform shell

This commit is contained in:
zowoq 2023-12-11 13:33:38 +10:00
parent 659ea8f2dd
commit 73e1cf8bf9
4 changed files with 3 additions and 44 deletions

17
flake.lock generated
View file

@ -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": [

View file

@ -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";

View file

@ -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:
"""

View file

@ -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