Skip to content

Instantly share code, notes, and snippets.

@ilyaGotfryd
Last active April 20, 2020 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilyaGotfryd/8dee190c8aa9298cb2bbfd7974402076 to your computer and use it in GitHub Desktop.
Save ilyaGotfryd/8dee190c8aa9298cb2bbfd7974402076 to your computer and use it in GitHub Desktop.
Trying to build configuration but get - error: cannot auto-call a function that has an argument without a default value ('config') in derivation.nix
nix-build --verbose --argstr sourcePath /root/source --argstr version 0.3.11 /etc/nixos/log_adapter_update_service.nix
evaluating file '/nix/store/hn9lrxibiaynx0i0cphgh96mjc1vjs1i-nix-2.3.3/share/nix/corepkgs/derivation.nix'
error: cannot auto-call a function that has an argument without a default value ('config')
{ config? <nixos-config>, lib? <nixos-lib>, pkgs ? import <nixpkgs>, logAdapterRev? null, logAdapterSha256? null, version? null, sourcePath? null, ... }:
let
# both variables derived in the external shell script to be passed to engine package to build a desired version
log_adapter_engine = import ./engine_package.nix { inherit pkgs;
logAdapterRev=logAdapterRev;
logAdapterSha256=logAdapterSha256;
version=version;
sourcePath=sourcePath;
};
cfg = config.systemd;
systemd = cfg.package;
in {
systemd.services."bvla_update@" = {
enable = true;
description = "Log Adapter Engine service - Update # %i";
environment = {
BVL_LAUNCHED_SERVICE_INDEX = "%i";
};
partOf = [ "bvla_update.target" ];
serviceConfig = {
LogsDirectory = "bvla";
ExecStart = "${log_adapter_engine}/bin/transmitters >'$\{LOGS_DIRECTORY\}/bvla_transmitters.out' 2>'$\{LOGS_DIRECTORY\}/bvla_transmitters.err'";
ExecReload="/run/current-system/sw/bin/kill -HUP $MAINPID";
Type="simple";
KillMode="process";
Restart="on-failure";
RestartSec="10s";
User="root";
};
};
systemd.targets.bvla_update = {
enable = true;
description = "Log Adapter Engine Update";
wantedBy = [ "multi-user.target" ];
after = [ "redis.service" ];
requires = [ "bvla_update@1.service" ];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment