Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/rootcell/providers/aws-ec2-terraform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,14 @@ if ! getent group users >/dev/null 2>&1; then
groupadd -r users
fi

if ! getent group docker >/dev/null 2>&1; then
groupadd -r docker
fi

if ! id -u "$user" >/dev/null 2>&1; then
useradd -m -u 501 -g users -G wheel -s /run/current-system/sw/bin/bash "$user"
useradd -m -u 501 -g users -G wheel,docker -s /run/current-system/sw/bin/bash "$user"
else
usermod -a -G wheel "$user"
usermod -a -G wheel,docker "$user"
mkdir -p "$home"
chown "$user:users" "$home"
fi
Expand Down
3 changes: 3 additions & 0 deletions src/rootcell/rootcell.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1510,6 +1510,9 @@ describe("VM and network providers", () => {
expect(hcl).toContain("data \"aws_ami\" \"nixos_arm64\"");
expect(hcl).toContain('values = ["arm64"]');
expect(hcl).toContain("user_data = local.rootcell_bootstrap_user_data");
expect(hcl).toContain("groupadd -r docker");
expect(hcl).toContain("useradd -m -u 501 -g users -G wheel,docker");
expect(hcl).toContain("usermod -a -G wheel,docker");
expect(hcl).not.toContain(" network_interface {");
expect(hcl).not.toContain("aws_s3_object");
expect(hcl).not.toContain("aws_ebs_snapshot_import");
Expand Down