-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
mainframe.nix
42 lines (37 loc) · 969 Bytes
/
mainframe.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ config, pkgs, lib, ... }:
let
cfg = config.services.mainframe;
in
with lib;
{
options = {
services.mainframe = {
user = mkOption {
default = "root";
type = with types; uniq string;
description = ''
Name of the user.
'';
};
};
};
config = {
systemd.services.mainframe = {
wantedBy = [ "multi-user.target" ];
after = [
"network.target"
];
description = "Start Mainframe";
path = with pkgs; [ bash nodejs-18_x ];
serviceConfig = {
WorkingDirectory = ./.;
ExecStart = "${pkgs.nodejs-18_x}/bin/npm run start";
User = "${cfg.user}";
};
};
environment.systemPackages = with pkgs.buildPackages; [
nodejs-18_x
bash
];
};
}