31 lines
876 B
Nix
31 lines
876 B
Nix
{
|
|
lib,
|
|
pkgs,
|
|
config,
|
|
...
|
|
}:
|
|
with lib; let
|
|
# WORK IN PROGRESS
|
|
# WORK IN PROGRESS
|
|
# WORK IN PROGRESS
|
|
# Shorter name to access final settings a
|
|
# user of hello.nix module HAS ACTUALLY SET.
|
|
# cfg is a typical convention.
|
|
cfg = config.services.vedirect-reader;
|
|
in {
|
|
# Declare what settings a user of this "hello.nix" module CAN SET.
|
|
options.services.vedirect-reader = {
|
|
enable = mkEnableOption "vedirect-reader";
|
|
};
|
|
|
|
# Define what other settings, services and resources should be active IF
|
|
# a user of this "hello.nix" module ENABLED this module
|
|
# by setting "services.hello.enable = true;".
|
|
config = mkIf cfg.enable {
|
|
systemd.services.vedirect-reader = {
|
|
wantedBy = ["multi-user.target"];
|
|
serviceConfig.ExecStart = "${pkgs.nodejs_20}/bin/node ${pkgs.vedirect-reader}/lib/node_modules/vedirect-reader/main.js";
|
|
};
|
|
};
|
|
}
|