nixos-config/modules/nixos/vedirect-reader.nix

31 lines
854 B
Nix
Raw Normal View History

2024-04-17 20:39:12 +02:00
{
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 = "node ${pkgs.vedirect-reader}/lib/node_modules/vedirect-reader/main.js";
};
};
}