Skip to content

Commit

Permalink
And actually use it
Browse files Browse the repository at this point in the history
  • Loading branch information
arianvp committed Nov 28, 2023
1 parent df33355 commit 0710fb3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

{
nixosModules = {
ec2-instance-connect = ./modules/ec2-instance-connect.nix;
amazonImage = ./modules/amazon-image.nix;
mock-imds = ./modules/mock-imds.nix;
version = { config, ... }: {
Expand Down Expand Up @@ -44,14 +45,17 @@

nixosConfigurations = {
amazonImage-x64_64-linux = lib.nixosSystem rec {
specialArgs.selfPackages = self.packages.${system};
pkgs = nixpkgs.legacyPackages.${system};
system = "x86_64-linux";
modules = [
self.nixosModules.ec2-instance-connect
self.nixosModules.amazonImage
self.nixosModules.version
];
};
legacyAmazonImage-x86_64-linux = lib.nixosSystem rec {
specialArgs.selfPackages = self.packages.${system};
pkgs = nixpkgs.legacyPackages.${system};
system = "x86_64-linux";
modules = [
Expand Down
6 changes: 5 additions & 1 deletion modules/ec2-instance-connect.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{ selfPackages, config, pkgs, ... }:
{
users.users.ec2-instance-connect = { };
users.groups.ec2-instance-connect = { };
users.users.ec2-instance-connect = {
isSystemUser = true;
group = "ec2-instance-connect";
};
services.openssh = {
authorizedKeysCommandUser = "ec2-instance-connect";
authorizedKeysCommand = "${selfPackages.ec2-instance-connect}/bin/ec2-instance-connect %u %f";
Expand Down

0 comments on commit 0710fb3

Please sign in to comment.