42 lines
1.1 KiB
Nix
42 lines
1.1 KiB
Nix
{ 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
|
|
# '';
|
|
};
|
|
}
|
|
|
|
|