feat: deployed frontend, postgres, rev-proxy, tailscale config, initialisation scripts

This commit is contained in:
Luka Dekanozishvili 2026-01-31 14:28:52 +01:00
parent f48059e37e
commit a24fd5bd93
20 changed files with 413 additions and 262 deletions

42
pkgs/frontend.nix Normal file
View file

@ -0,0 +1,42 @@
{ pkgs, hexname-frontend, ... }:
{
nixpkgs.overlays = [
(self: super: {
hexname-frontend = hexname-frontend.packages.${super.stdenv.hostPlatform.system}.default;
})
];
users.groups.hexname = {};
users.users = {
hexname-frontend = {
group = "hexname";
isSystemUser = true;
createHome = true;
home = "/var/lib/hexname/frontend";
};
};
systemd.services.hexname-frontend = {
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
environment = {
ENV_PATH = "/etc/env/hexname/frontend.env";
NODE_ENV = "production";
};
serviceConfig = {
User = "hexname-backend";
Group = "hexname";
Type = "simple";
Restart = "always";
# ExecStart = "${hexname-frontend.packages.${pkgs.system}.default}/bin/hexname-frontend";
ExecStart = "env $(cat $ENV_PATH | xargs) ${pkgs.hexname-frontend}/bin/hexname-frontend";
};
# script = ''
# source /etc/env/hexname/frontend.env
# ${hexname-frontend.packages.${pkgs.system}.default}/bin/hexname-frontend
# '';
};
}