add AWS Lambda/Rust, utilizing rust flake as base

This commit is contained in:
Emil Lerch 2024-11-06 10:26:41 -08:00
parent 386f7cd690
commit 19a5f9ae07
Signed by: lobo
GPG Key ID: A7B62D657EF764F8
2 changed files with 156 additions and 0 deletions

127
aws-rust-lambda/flake.lock Normal file
View File

@ -0,0 +1,127 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1730785428,
"narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1730272153,
"narHash": "sha256-B5WRZYsRlJgwVHIV6DvidFN7VX7Fg9uuwkRW9Ha8z+w=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixpkgs-unstable",
"type": "indirect"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"rust-flake": "rust-flake"
}
},
"rust-flake": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"dir": "/rust",
"narHash": "sha256-gu3plp+xRyVCCAO0IS633xMCxFbMVB7Pok8uYh9OPXc=",
"type": "tarball",
"url": "https://git.lerch.org/lobo/nix-flake-examples/archive/master.tar.gz?dir=/rust"
},
"original": {
"dir": "/rust",
"type": "tarball",
"url": "https://git.lerch.org/lobo/nix-flake-examples/archive/master.tar.gz?dir=/rust"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

29
aws-rust-lambda/flake.nix Normal file
View File

@ -0,0 +1,29 @@
# lambda-flake/flake.nix
{
description = "AWS Lambda deployment flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-flake.url = "https://git.lerch.org/lobo/nix-flake-examples/archive/master.tar.gz?dir=/rust"; # Adjust this path as needed
# rust-flake.url = "https://git.lerch.org/lobo/nix-flake-examples/archive/master.tar.gz?dir=/rust"; # Adjust this path as needed
};
outputs = { self, nixpkgs, flake-utils, rust-flake }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
buildInputs = [
# Include Rust tools from the rust-flake
rust-flake.devShells.${system}.default.buildInputs
# Add AWS Lambda deployment tools
pkgs.cargo-lambda
];
};
}
);
}