mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-04-02 11:12:09 +02:00
add modules
This commit is contained in:
@@ -9,6 +9,9 @@
|
|||||||
../../nixos/tailscale.nix
|
../../nixos/tailscale.nix
|
||||||
|
|
||||||
../../server-modules/ssh.nix
|
../../server-modules/ssh.nix
|
||||||
|
../../server-modules/bitwarden.nix
|
||||||
|
../../server-modules/firewall.nix
|
||||||
|
../../server-modules/nginx.nix
|
||||||
|
|
||||||
# You should let those lines as is
|
# You should let those lines as is
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
path = "/home/hadi/.ssh/jack";
|
path = "/home/hadi/.ssh/jack";
|
||||||
mode = "0600";
|
mode = "0600";
|
||||||
};
|
};
|
||||||
|
cloudflare-dns-token = { path = "/etc/cloudflare/dnskey.txt"; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
34
server-modules/bitwarden.nix
Normal file
34
server-modules/bitwarden.nix
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{ config, ... }:
|
||||||
|
let domain = "vault.hadi.diy";
|
||||||
|
in {
|
||||||
|
services.vaultwarden = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
DOMAIN = "https://" + domain;
|
||||||
|
SIGNUPS_ALLOWED = true;
|
||||||
|
ROCKET_ADDRESS = "127.0.0.1";
|
||||||
|
ROCKET_PORT = 8222;
|
||||||
|
ROCKET_LOG = "critical";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."${domain}" = {
|
||||||
|
useACMEHost = "hadi.diy";
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://127.0.0.1:${
|
||||||
|
toString config.services.vaultwarden.config.ROCKET_PORT
|
||||||
|
}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
security.acme.certs."hadi.diy" = {
|
||||||
|
domain = "hadi.diy";
|
||||||
|
extraDomainNames = [ "*.hadi.diy" ];
|
||||||
|
group = "nginx";
|
||||||
|
|
||||||
|
dnsProvider = "cloudflare";
|
||||||
|
dnsPropagationCheck = true;
|
||||||
|
credentialsFile = config.sops.secrets.cloudflare-dns-token.path;
|
||||||
|
};
|
||||||
|
}
|
||||||
6
server-modules/firewall.nix
Normal file
6
server-modules/firewall.nix
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
networking.firewall = {
|
||||||
|
enable = true;
|
||||||
|
allowPing = false;
|
||||||
|
};
|
||||||
|
}
|
||||||
10
server-modules/nginx.nix
Normal file
10
server-modules/nginx.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{ config, ... }: {
|
||||||
|
services.nginx = { enable = true; };
|
||||||
|
|
||||||
|
security.acme = {
|
||||||
|
acceptTerms = true;
|
||||||
|
defaults.email = config.var.git.email;
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user