40 lines
1 KiB
Nix
40 lines
1 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
|
|
|
disko.url = "github:nix-community/disko";
|
|
disko.inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
outputs = inputs@{ flake-parts, ... }:
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
systems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
];
|
|
|
|
perSystem = { system, pkgs, ... }:
|
|
let
|
|
tofuPkg = pkgs.opentofu.withPlugins (p: [
|
|
pkgs.terraform-providers.hcloud
|
|
pkgs.terraform-providers.null
|
|
pkgs.terraform-providers.external
|
|
]);
|
|
in {
|
|
devShells.default = pkgs.mkShell {
|
|
buildInputs = [
|
|
tofuPkg
|
|
pkgs.terraform-ls
|
|
];
|
|
|
|
shellHook = ''
|
|
alias tofu-plan="tofu plan -var-file=secret.tfvars"
|
|
alias tofu-apply="tofu apply -var-file=secret.tfvars"
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|