-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add template for terranix (#43)
- Loading branch information
1 parent
efba3eb
commit ac7e620
Showing
7 changed files
with
106 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
{ | ||
inputs = { | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
nixpkgs-terraform.url = "github:stackbuilders/nixpkgs-terraform"; | ||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; | ||
systems.url = "github:nix-systems/default"; | ||
}; | ||
|
||
nixConfig = { | ||
extra-substituters = "https://nixpkgs-terraform.cachix.org"; | ||
extra-trusted-public-keys = "nixpkgs-terraform.cachix.org-1:8Sit092rIdAVENA3ZVeH9hzSiqI/jng6JiCrQ1Dmusw="; | ||
}; | ||
|
||
outputs = { self, flake-utils, nixpkgs-terraform, nixpkgs }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
terraform = nixpkgs-terraform.packages.${system}."1.7.2"; | ||
in | ||
{ | ||
devShells.default = pkgs.mkShell { | ||
buildInputs = [ terraform ]; | ||
}; | ||
}); | ||
outputs = { self, nixpkgs-terraform, nixpkgs, systems }: | ||
let | ||
forEachSystem = nixpkgs.lib.genAttrs (import systems); | ||
in | ||
{ | ||
devShells = forEachSystem | ||
(system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
terraform = nixpkgs-terraform.packages.${system}."1.7.4"; | ||
in | ||
{ | ||
default = pkgs.mkShell { | ||
buildInputs = [ terraform ]; | ||
}; | ||
}); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,37 @@ | ||
{ | ||
inputs = { | ||
devenv.url = "github:cachix/devenv"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
nixpkgs-terraform.url = "github:stackbuilders/nixpkgs-terraform"; | ||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; | ||
systems.url = "github:nix-systems/default"; | ||
}; | ||
|
||
nixConfig = { | ||
extra-substituters = "https://nixpkgs-terraform.cachix.org"; | ||
extra-trusted-public-keys = "nixpkgs-terraform.cachix.org-1:8Sit092rIdAVENA3ZVeH9hzSiqI/jng6JiCrQ1Dmusw="; | ||
}; | ||
|
||
outputs = inputs@{ self, devenv, flake-utils, nixpkgs-terraform, nixpkgs }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
terraform = nixpkgs-terraform.packages.${system}."1.7.2"; | ||
in | ||
{ | ||
devShells.default = devenv.lib.mkShell { | ||
inherit inputs pkgs; | ||
modules = [ | ||
({ pkgs, config, ... }: { | ||
languages.terraform.enable = true; | ||
languages.terraform.package = terraform; | ||
}) | ||
]; | ||
}; | ||
}); | ||
outputs = inputs@{ self, devenv, nixpkgs-terraform, nixpkgs, systems }: | ||
let | ||
forEachSystem = nixpkgs.lib.genAttrs (import systems); | ||
in | ||
{ | ||
devShells = forEachSystem | ||
(system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
terraform = nixpkgs-terraform.packages.${system}."1.7.4"; | ||
in | ||
{ | ||
default = devenv.lib.mkShell { | ||
inherit inputs pkgs; | ||
modules = [ | ||
({ pkgs, config, ... }: { | ||
languages.terraform.enable = true; | ||
languages.terraform.package = terraform; | ||
}) | ||
]; | ||
}; | ||
}); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Example config.nix from https://terranix.org/documentation/getting-started.html, | ||
# Make sure to update it with your own resources before applying. | ||
{ ... }: | ||
{ | ||
resource.hcloud_server.nginx = { | ||
name = "terranix.nginx"; | ||
image = "debian-10"; | ||
server_type = "cx11"; | ||
backups = false; | ||
}; | ||
resource.hcloud_server.test = { | ||
name = "terranix.test"; | ||
image = "debian-9"; | ||
server_type = "cx11"; | ||
backups = true; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
inputs = { | ||
nixpkgs-terraform.url = "github:stackbuilders/nixpkgs-terraform"; | ||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; | ||
systems.url = "github:nix-systems/default"; | ||
terranix.url = "github:terranix/terranix"; | ||
}; | ||
|
||
nixConfig = { | ||
extra-substituters = "https://nixpkgs-terraform.cachix.org"; | ||
extra-trusted-public-keys = "nixpkgs-terraform.cachix.org-1:8Sit092rIdAVENA3ZVeH9hzSiqI/jng6JiCrQ1Dmusw="; | ||
}; | ||
|
||
outputs = { self, nixpkgs-terraform, nixpkgs, systems, terranix }: | ||
let | ||
forEachSystem = nixpkgs.lib.genAttrs (import systems); | ||
in | ||
{ | ||
packages = forEachSystem (system: { | ||
default = terranix.lib.terranixConfiguration { | ||
inherit system; | ||
modules = [ ./config.nix ]; | ||
}; | ||
}); | ||
devShells = forEachSystem | ||
(system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
terraform = nixpkgs-terraform.packages.${system}."1.7.4"; | ||
in | ||
{ | ||
default = pkgs.mkShell { | ||
buildInputs = [ terraform pkgs.terranix]; | ||
}; | ||
}); | ||
}; | ||
} |