initial commit
This commit is contained in:
8
README.md
Normal file
8
README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# Testaform
|
||||
|
||||
Testing terraform out
|
||||
|
||||
---
|
||||
|
||||
|
||||
Add `dotenv` to .envrc after other nix stuff, and store keys in .env, which is fine for a testing project.
|
||||
62
flake.lock
generated
Normal file
62
flake.lock
generated
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1755615617,
|
||||
"narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "20075955deac2583bb12f07151c2df830ef346b4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1754340878,
|
||||
"narHash": "sha256-lgmUyVQL9tSnvvIvBp7x1euhkkCho7n3TMzgjdvgPoU=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "cab778239e705082fe97bb4990e0d24c50924c04",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
}
|
||||
},
|
||||
"treefmt-nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1755934250,
|
||||
"narHash": "sha256-CsDojnMgYsfshQw3t4zjRUkmMmUdZGthl16bXVWgRYU=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "74e1a52d5bd9430312f8d1b8b0354c92c17453e5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
48
flake.nix
Normal file
48
flake.nix
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
description = "Basic flake and files - change me";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||
};
|
||||
outputs =
|
||||
{ nixpkgs, ... }@inputs:
|
||||
let
|
||||
supportedSystems = [ "x86_64-linux" ];
|
||||
pkgsFor =
|
||||
system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
in
|
||||
pkgs.extend (
|
||||
nixpkgs.lib.composeManyExtensions [ ]
|
||||
# nixpkgs.lib.composeManyExtensions ([ ] ++ builtins.attrValues self.overlays)
|
||||
);
|
||||
eachSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f (pkgsFor system));
|
||||
|
||||
treefmtEval = eachSystem (pkgs: inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
|
||||
in
|
||||
{
|
||||
# nix fmt formatter
|
||||
formatter = eachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
|
||||
|
||||
# default devshell
|
||||
|
||||
devShells = eachSystem (pkgs: {
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
just
|
||||
awscli2
|
||||
terraform
|
||||
];
|
||||
|
||||
# Will be executed before entering the shell
|
||||
# or running a command
|
||||
shellHook = '''';
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
25
justfile
Normal file
25
justfile
Normal file
@@ -0,0 +1,25 @@
|
||||
# by default list all just commands
|
||||
default:
|
||||
just --list
|
||||
|
||||
# run all tests
|
||||
test:
|
||||
#!/usr/bin/env bash
|
||||
set -euxo pipefail
|
||||
|
||||
# would love test: fmt to make sure formatting happens but in WSL formatting is slow...
|
||||
# poor filesystem access performance
|
||||
|
||||
echo "testing..."
|
||||
nix flake check
|
||||
# uv run ruff check src tests
|
||||
|
||||
#
|
||||
|
||||
# format code
|
||||
fmt:
|
||||
#!/usr/bin/env bash
|
||||
set -euxo pipefail
|
||||
nix fmt
|
||||
# shouldn't actually be that hard to put into nix fmt but lazyyy
|
||||
terraform fmt
|
||||
10
terraform.tf
Normal file
10
terraform.tf
Normal file
@@ -0,0 +1,10 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = "~> 5.92"
|
||||
}
|
||||
}
|
||||
|
||||
required_version = ">= 1.2"
|
||||
}
|
||||
21
treefmt.nix
Normal file
21
treefmt.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
# treefmt.nix
|
||||
{ ... }:
|
||||
{
|
||||
projectRootFile = "treefmt.nix";
|
||||
settings.global.excludes = [
|
||||
"*.toml"
|
||||
"*.txt"
|
||||
".gitattributes"
|
||||
"CLAUDE.md"
|
||||
".python-version"
|
||||
];
|
||||
|
||||
programs.deadnix.enable = true;
|
||||
programs.mdsh.enable = true;
|
||||
programs.nixfmt.enable = true;
|
||||
programs.shellcheck.enable = true;
|
||||
programs.shfmt.enable = true;
|
||||
programs.yamlfmt.enable = true;
|
||||
programs.just.enable = true;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user