add terraform

This commit is contained in:
Peter Tillemans 2024-06-04 13:41:11 +02:00
parent 1150f8acd2
commit 920099dad0
2 changed files with 47 additions and 32 deletions

View file

@ -1,32 +0,0 @@
(define-module (infra)
#:use-module (guix packages)
#:use-module (guix git-download)
#:use-module (guix build-system go)
#:use-module ((guix licenses) #:prefix license:)
)
(define-public terraform
(package
(name "terraform")
(version "1.8.4")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/hashicorp/terraform")
(commit (string-append "v" version))))
(sha256
(base32
"0q8x6fhhkh4spddbqsxbsc2fp0r5p5010awgkb628s9vz111ws3r"))))
(build-system go-build-system)
(arguments
'(#:import-path "github.com/hashicorp/terraform"))
(synopsis "Tool for building, changing, and versioning infrastructure")
(description
"Terraform enables you to safely and predictably create, change, and
improve infrastructure. It is an open source tool that codifies APIs into
declarative configuration files that can be shared amongst team members,
treated as code, edited, reviewed, and versioned.")
(home-page "https://www.terraform.io/")
(license license:mpl2.0)))
terraform

47
packages/terraform.scm Normal file
View file

@ -0,0 +1,47 @@
(define-module (terraform)
#:use-module (guix packages)
#:use-module (gnu packages golang)
#:use-module (gnu packages base)
#:use-module (gnu packages compression)
#:use-module (gnu packages gcc)
#:use-module (guix download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (nonguix build-system binary))
(define-public snam-terraform
(package
(name "snam-terraform")
(version "1.8.4")
(source (origin
(method url-fetch)
(uri (string-append "https://releases.hashicorp.com/terraform/" version "/terraform_" version "_linux_amd64.zip"))
(sha256
(base32
"1i181cmzwlrx8d40z1spilcwgnhkzwalrg8822d23sqdmrs7a5hj"))))
(build-system binary-build-system)
(supported-systems '("x86_64-linux"))
(arguments '(
#:install-plan
`(("." ("terraform") "bin/"))
#:phases
(modify-phases %standard-phases
;; this is required because standard unpack expects
;; the archive to contain a directory with everything inside it,
;; while babashka's release .tar.gz only contains the `bb` binary.
(replace 'unpack
(lambda* (#:key inputs #:allow-other-keys)
(system* (which "unzip")
(assoc-ref inputs "source"))
#t)))))
(inputs
`(("libstdc++" ,(make-libstdc++ gcc))
("zlib" ,zlib)))
(native-inputs
`(("unzip" ,unzip)))
(synopsis "A tool to describe and deploy infrastructure as code")
(description
"Terraform allows you to describe your complete infrastructure in the form of code. Even if your servers come from different providers such as AWS or Azure, Terraform helps you build and manage these resources in parallel across providers.")
(home-page "https://hashicorp.com/terraform")
(license #f)))
snam-terraform