mirror of
https://github.com/vale981/phoebe
synced 2025-03-05 09:51:37 -05:00

The new `services' option is used to request additional processes be run in the background with the same environment as the main Rails process.
27 lines
655 B
Nix
27 lines
655 B
Nix
# Functions for generating and working with shell scripts:
|
|
{ lib, pkgs, ... }:
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
|
funcs = rec {
|
|
|
|
# Generate a shell script that exports the given variables.
|
|
#
|
|
# Type:
|
|
#
|
|
# string -> attrset -> derivation
|
|
#
|
|
# Arguments:
|
|
#
|
|
# fileName: The name of the file in the nix store to create.
|
|
# attrs: The variables to include in the generated script.
|
|
#
|
|
attrsToShellExports = fileName: attrs:
|
|
let export = name: value: "export ${name}=${escapeShellArg value}";
|
|
lines = mapAttrsToList export attrs;
|
|
in pkgs.writeText fileName (concatStringsSep "\n" lines);
|
|
};
|
|
|
|
in funcs
|