l002 nixos mode
This commit is contained in:
parent
e067fb9f54
commit
2e6720e6e7
12 changed files with 362 additions and 52 deletions
|
@ -1,7 +1,71 @@
|
|||
{
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
boot.loader.grub.enable = true;
|
||||
system.stateVersion = "24.11";
|
||||
|
||||
containers.wasabi = {
|
||||
ephemeral = true;
|
||||
autoStart = true;
|
||||
privateNetwork = true;
|
||||
hostAddress = "192.168.100.2";
|
||||
localAddress = "192.168.100.11";
|
||||
config =
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
system.stateVersion = "24.11";
|
||||
services.httpd.enable = true;
|
||||
services.httpd.adminAddr = "foo@example.org";
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [ 80 ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.oci-containers = {
|
||||
backend = "docker"; # or "podman"
|
||||
containers = {
|
||||
# Example of defining a container from the compose file
|
||||
"test_nginx" = {
|
||||
# autoStart = true; this is default true
|
||||
image = "nginx:latest";
|
||||
ports = [
|
||||
"127.0.0.1:8085:80"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
security.acme.acceptTerms = true;
|
||||
security.acme.email = "admin@joshuabell.xyz";
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedProxySettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
virtualHosts = {
|
||||
"_" = {
|
||||
default = true;
|
||||
locations."/wasabi/" = {
|
||||
extraConfig = ''
|
||||
rewrite ^/wasabi/(.*) /$1 break;
|
||||
'';
|
||||
proxyPass = "http://${config.containers.wasabi.localAddress}:80/";
|
||||
};
|
||||
locations."/" = {
|
||||
# return = "404"; # or 444 for drop
|
||||
proxyPass = "http://127.0.0.1:8085/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
];
|
||||
}
|
||||
|
|
|
@ -19,6 +19,21 @@
|
|||
lib = nixpkgs.lib;
|
||||
in
|
||||
{
|
||||
deploy = {
|
||||
sshUser = "root";
|
||||
sshOpts = [
|
||||
"-i"
|
||||
"/run/agenix/nix2l002"
|
||||
];
|
||||
nodes.${configuration_name} = {
|
||||
hostname = "172.232.11.143";
|
||||
profiles.system = {
|
||||
user = "root";
|
||||
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.${configuration_name};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nixosConfigurations = {
|
||||
nixos = self.nixosConfigurations.${configuration_name};
|
||||
"${configuration_name}" =
|
||||
|
@ -42,6 +57,7 @@
|
|||
{
|
||||
users.users.root.openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFLBVLiPbhVG+riNNpkvXnNtOioByV3CQwtY9gu8pstp nix2l002"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJuo6L6V52AzdQIK6fWW9s0aX1yKUUTXbPd8v8IU9p2o nix2linode"
|
||||
];
|
||||
mods = {
|
||||
common = {
|
||||
|
@ -59,6 +75,7 @@
|
|||
isNormalUser = true;
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFLBVLiPbhVG+riNNpkvXnNtOioByV3CQwtY9gu8pstp nix2l002"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJuo6L6V52AzdQIK6fWW9s0aX1yKUUTXbPd8v8IU9p2o nix2linode"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
@ -72,20 +89,5 @@
|
|||
};
|
||||
});
|
||||
};
|
||||
|
||||
deploy = {
|
||||
sshUser = "root";
|
||||
sshOpts = [
|
||||
"-i"
|
||||
"/run/agenix/nix2l002"
|
||||
];
|
||||
nodes.${configuration_name} = {
|
||||
hostname = "172.232.20.245";
|
||||
profiles.system = {
|
||||
user = "root";
|
||||
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.${configuration_name};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue