Skip to content

Commit

Permalink
introduce lego-router
Browse files Browse the repository at this point in the history
Signed-off-by: iosmanthus <[email protected]>
  • Loading branch information
iosmanthus committed May 7, 2024
1 parent af724bb commit 1d9f746
Show file tree
Hide file tree
Showing 71 changed files with 1,104 additions and 471 deletions.
102 changes: 51 additions & 51 deletions flake.lock

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

38 changes: 24 additions & 14 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -199,22 +199,10 @@
self.nixosModules.atuin
self.nixosModules.cloud.aws-lightsail
self.nixosModules.cloud.sing-box
self.nixosModules.gemini-openai-proxy
self.nixosModules.o11y
self.nixosModules.subgen

home-manager.nixosModules.home-manager
({ config, ... }: {
home-manager = {
users.nixbuild = { ... }: {
imports = [
./nixos/aws-lightsail-0/home
];
};
useGlobalPkgs = true;
verbose = true;
};
})

{
nixpkgs.overlays = [
self.overlays.default
Expand Down Expand Up @@ -268,6 +256,28 @@
}
];
};

lego-router = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit self;
};
modules = [
./nixos/lego-router
./secrets/lego-router

sops-nix.nixosModules.sops
self.nixosModules.cloud.base
self.nixosModules.nixbuild
self.nixosModules.sing-box

{
nixpkgs.overlays = [
self.overlays.default
];
}
];
};
};
} // flake-utils.lib.eachSystem
[ "x86_64-linux" ]
Expand All @@ -283,7 +293,7 @@
buildInputs = with pkgs; [
fd
gnumake
go_1_20
go_1_21
google-cloud-sdk
gotools
nix-output-monitor
Expand Down
3 changes: 1 addition & 2 deletions infra/aws-lightsail/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/.terraform
*.tfstate
*.tfstate.*
*.tfstate.backup
6 changes: 6 additions & 0 deletions infra/aws-lightsail/.sops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
keys:
- &iosmanthus age12409ktkdynl48p38wz45pu2s25kmffsw4p9d9vgt3xmmwl8f7q7sjlxyrs
creation_rules:
- key_groups:
- age:
- *iosmanthus
11 changes: 11 additions & 0 deletions infra/aws-lightsail/apply.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

function recover {
sops -e -i terraform.tfvars.json
sops -e -i terraform.tfstate
}

sops -d -i terraform.tfvars.json
sops -d -i terraform.tfstate
trap recover EXIT
terraform apply -auto-approve $@
Loading

0 comments on commit 1d9f746

Please sign in to comment.