Skip to content

Commit

Permalink
Use map instead of genList
Browse files Browse the repository at this point in the history
  • Loading branch information
robbevp committed Sep 17, 2023
1 parent 1ea5adc commit efbe7d3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,14 @@ in
ExecStart = "${gems}/bin/puma -C ${api}/config/puma.rb";
};
};
} // (builtins.foldl' (x: y: x // y) { } (builtins.genList
(index: {
} // (builtins.foldl' (x: y: x // y) { } (lib.lists.imap0
(index: value: {
"accentor-worker-${toString (index)}" = {
after = [ "network.target" "accentor-api.service" "postgresql.service" ];
requires = [ "postgresql.service" ];
wantedBy = [ "multi-user.target" ];
environment = env // {
GOOD_JOB_QUEUES = (builtins.elemAt cfg.workers index);
GOOD_JOB_QUEUES = value;
};
path = [ pkgs.ffmpeg gems gems.wrappedRuby ];
serviceConfig = {
Expand All @@ -200,8 +200,7 @@ in
ExecStart = "${gems}/bin/bundle exec good_job start";
};
};
})
(builtins.length cfg.workers)))
})))
// (builtins.foldl' (x: y: x // y) { } (builtins.genList
(n: {
"accentor-worker-delayed${toString n}" = {
Expand Down

0 comments on commit efbe7d3

Please sign in to comment.