unpin terraform shell
This commit is contained in:
parent
659ea8f2dd
commit
73e1cf8bf9
4 changed files with 3 additions and 44 deletions
17
flake.lock
generated
17
flake.lock
generated
|
@ -238,7 +238,6 @@
|
||||||
"nur-update": "nur-update",
|
"nur-update": "nur-update",
|
||||||
"sops-nix": "sops-nix",
|
"sops-nix": "sops-nix",
|
||||||
"srvos": "srvos",
|
"srvos": "srvos",
|
||||||
"tf-pkgs": "tf-pkgs",
|
|
||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -284,22 +283,6 @@
|
||||||
"type": "github"
|
"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": {
|
"treefmt-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
|
|
@ -41,8 +41,6 @@
|
||||||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||||
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
|
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.url = "github:hercules-ci/hercules-ci-agent";
|
||||||
hercules-ci-agent.inputs.flake-parts.follows = "flake-parts";
|
hercules-ci-agent.inputs.flake-parts.follows = "flake-parts";
|
||||||
#hercules-ci-agent.inputs.nixpkgs.follows = "nixpkgs";
|
#hercules-ci-agent.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
21
tasks.py
21
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
|
@task
|
||||||
def mkdocs(c: Any) -> None:
|
def mkdocs(c: Any) -> None:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
{ inputs', ... }:
|
{ pkgs, ... }:
|
||||||
let
|
let
|
||||||
tf-pkgs = inputs'.tf-pkgs.legacyPackages;
|
terraform' = pkgs.terraform.overrideAttrs (_: { meta = { }; });
|
||||||
terraform' = tf-pkgs.terraform.overrideAttrs (_: { meta = { }; });
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
devShells = {
|
devShells = {
|
||||||
terraform = with tf-pkgs; mkShellNoCC {
|
terraform = with pkgs; mkShellNoCC {
|
||||||
packages = [
|
packages = [
|
||||||
(terraform'.withPlugins (p: [
|
(terraform'.withPlugins (p: [
|
||||||
p.cloudflare
|
p.cloudflare
|
||||||
|
|
Loading…
Add table
Reference in a new issue