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