Skip to content

Commit

Permalink
feat: nix + opentofu + import existing infra
Browse files Browse the repository at this point in the history
check the readme diff for more details
  • Loading branch information
schradert committed Mar 31, 2024
1 parent 6bc5183 commit 34a8d93
Show file tree
Hide file tree
Showing 11 changed files with 636 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if command -v nix &> /dev/null; then
use flake
fi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ venv/
static/img/
*.swp
scripts/__pycache__/
/.direnv/
/.pre-commit-config.yaml
result
307 changes: 307 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
description = "Vegans In Love with Food";
inputs = {
canivete.url = github:schradert/canivete;
nixpkgs.follows = "canivete/nixpkgs";
nixpkgs-stable.follows = "canivete/nixpkgs-stable";
flake-parts.follows = "canivete/flake-parts";
pre-commit.follows = "canivete/pre-commit";
systems.follows = "canivete/systems";

terranix.url = github:terranix/terranix;
terranix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs:
with inputs;
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [canivete.flakeModules.default ./infra];
systems = import systems;
perSystem = {
pkgs,
self',
...
}: {
packages.default = pkgs.writeShellApplication {
name = "vilf";
excludeShellChecks = ["SC2015"];
text = ''
nixCmd() { nix --extra-experimental-features "nix-command flakes" "$@"; }
[[ -z ''${1-} || $1 == default ]] && nixCmd flake show || nixCmd run ".#$1" -- "''${@:2}"
'';
};
devShells.cli = pkgs.mkShell {
packages = [self'.packages.default];
};
};
};
}
1 change: 1 addition & 0 deletions infra/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.terraform/
9 changes: 9 additions & 0 deletions infra/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 34a8d93

Please sign in to comment.