feat: deployed frontend, postgres, rev-proxy, tailscale config, initialisation scripts
This commit is contained in:
parent
f48059e37e
commit
a24fd5bd93
20 changed files with 413 additions and 262 deletions
42
pkgs/frontend.nix
Normal file
42
pkgs/frontend.nix
Normal 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
|
||||
# '';
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue