mirror of
https://github.com/vale981/phoebe
synced 2025-03-05 09:51:37 -05:00
rails: Decouple helper functions from the config variable
This commit is contained in:
parent
bd9408849d
commit
3a322a114a
4 changed files with 9 additions and 11 deletions
|
@ -12,7 +12,7 @@ let
|
|||
##############################################################################
|
||||
options = import ./options.nix { inherit config lib pkgs; };
|
||||
appSystemd = import ./systemd.nix { inherit config pkgs lib; };
|
||||
funcs = import ./functions.nix { inherit config; };
|
||||
funcs = import ./functions.nix;
|
||||
scripts = import ./scripts.nix { inherit lib pkgs; };
|
||||
|
||||
##############################################################################
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
{ config }:
|
||||
|
||||
rec {
|
||||
|
||||
##############################################################################
|
||||
|
@ -14,10 +12,6 @@ rec {
|
|||
# Path to where the app is actually installed:
|
||||
appLink = app: "${app.home}/package";
|
||||
|
||||
##############################################################################
|
||||
# Is PostgreSQL local?
|
||||
localpg = config.phoebe.services.postgresql.enable;
|
||||
|
||||
##############################################################################
|
||||
# Packages to put in the application's PATH. FIXME:
|
||||
# propagatedBuildInputs won't always be set.
|
||||
|
|
|
@ -4,7 +4,7 @@ with lib;
|
|||
|
||||
let
|
||||
##############################################################################
|
||||
functions = import ./functions.nix { inherit config; };
|
||||
functions = import ./functions.nix;
|
||||
|
||||
##############################################################################
|
||||
# Database configuration:
|
||||
|
|
|
@ -10,9 +10,13 @@ let
|
|||
##############################################################################
|
||||
# Helpful functions.
|
||||
plib = config.phoebe.lib;
|
||||
funcs = import ./functions.nix { inherit config; };
|
||||
funcs = import ./functions.nix;
|
||||
scripts = import ./scripts.nix { inherit lib pkgs; };
|
||||
|
||||
##############################################################################
|
||||
# Is PostgreSQL local?
|
||||
localpg = config.phoebe.services.postgresql.enable;
|
||||
|
||||
##############################################################################
|
||||
# The main Rails service:
|
||||
mainService = app: {
|
||||
|
@ -44,8 +48,8 @@ let
|
|||
|
||||
after =
|
||||
[ "network.target" ] ++
|
||||
optional funcs.localpg "postgresql.service" ++
|
||||
optional funcs.localpg "pg-accounts.service" ++
|
||||
optional localpg "postgresql.service" ++
|
||||
optional localpg "pg-accounts.service" ++
|
||||
optional (!service.isMain) "rails-${app.name}-main" ++
|
||||
plib.keyService app.database.passwordFile ++
|
||||
plib.keyService app.sourcedFile ++
|
||||
|
|
Loading…
Add table
Reference in a new issue