Compare commits
2 commits
3296b3a7cf
...
53fa753a13
Author | SHA1 | Date | |
---|---|---|---|
53fa753a13 | |||
fc6cf2962e |
3 changed files with 65 additions and 7 deletions
|
@ -1,5 +1,9 @@
|
||||||
{ pkgs, ... }@inputs: {
|
{ pkgs, ... }@inputs: {
|
||||||
imports = [ ./hardware-configuration.nix ./misskey-service.nix ];
|
imports = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
./misskey-service.nix
|
||||||
|
./heartles-xyz-proxy.nix
|
||||||
|
];
|
||||||
|
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
|
12
flake.lock
generated
12
flake.lock
generated
|
@ -2,11 +2,11 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1708831307,
|
"lastModified": 1709128929,
|
||||||
"narHash": "sha256-0iL/DuGjiUeck1zEaL+aIe2WvA3/cVhp/SlmTcOZXH4=",
|
"narHash": "sha256-GWrv9a+AgGhG4/eI/CyVVIIygia7cEy68Huv3P8oyaw=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "5bf1cadb72ab4e77cb0b700dab76bcdaf88f706b",
|
"rev": "c8e74c2f83fe12b4e5a8bd1abbc090575b0f7611",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -41,11 +41,11 @@
|
||||||
},
|
},
|
||||||
"unstable": {
|
"unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1708807242,
|
"lastModified": 1709150264,
|
||||||
"narHash": "sha256-sRTRkhMD4delO/hPxxi+XwLqPn8BuUq6nnj4JqLwOu0=",
|
"narHash": "sha256-HofykKuisObPUfj0E9CJVfaMhawXkYx3G8UIFR/XQ38=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "73de017ef2d18a04ac4bfd0c02650007ccb31c2a",
|
"rev": "9099616b93301d5cf84274b184a3a5ec69e94e08",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
54
heartles-xyz-proxy.nix
Normal file
54
heartles-xyz-proxy.nix
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
{ config, lib, ... }: {
|
||||||
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
|
|
||||||
|
security.acme = {
|
||||||
|
acceptTerms = true;
|
||||||
|
defaults.email = "admin+acme@heartles.xyz";
|
||||||
|
certs."STAR.home.heartles.xyz" = {
|
||||||
|
domain = "*.home.heartles.xyz";
|
||||||
|
dnsProvider = "namecheap";
|
||||||
|
credentialsFile = "/etc/nixos-secrets/namecheap-acme";
|
||||||
|
group = "nginx";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
virtualHosts = {
|
||||||
|
"*.home.heartles.xyz" = {
|
||||||
|
listen = [
|
||||||
|
{
|
||||||
|
port = 443;
|
||||||
|
addr = "0.0.0.0";
|
||||||
|
ssl = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
port = 80;
|
||||||
|
addr = "0.0.0.0";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
port = 443;
|
||||||
|
addr = "[::]";
|
||||||
|
ssl = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
port = 80;
|
||||||
|
addr = "[::]";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
useACMEHost = "STAR.home.heartles.xyz";
|
||||||
|
forceSSL = true;
|
||||||
|
|
||||||
|
locations."/" = {
|
||||||
|
proxyWebsockets = true;
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_ssl_name $host;
|
||||||
|
include /etc/nixos-secrets/nginx-proxy-pass-home.conf;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue