-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdefault.nix
33 lines (27 loc) · 1.09 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ sources ? null
, customVarsPath ? ./custom_vars.nix
, varsOverride ? {} }:
with builtins;
let
deps = import ./nix/deps.nix { inherit sources; };
inherit (deps) mylib php pkgs vvvote apacheHttpd;
lib = pkgs.lib;
# Recursively merge custom settings from customVarsPath into the default config.
# Vars from the default config can be accessed with `super`.
# Config settings can refer to other settings using `self`.
# See `extends` in `nixpkgs/lib/trivial.nix` for details.
vars =
lib.recursiveUpdate
(lib.fix'
(mylib.extendsRec
(scopedImport { inherit pkgs lib; inherit (mylib) composeConfig; } customVarsPath)
(import ./default_vars.nix)))
varsOverride;
listen = with vars; "${backend.httpAddress}:${toString backend.httpPort}";
pidfile = "/dev/shm/vvvote_${toString vars.serverNumber}.pid";
backendConfigDir = pkgs.callPackage ./nix/config_dir.nix { inherit sources vars; };
serveApp = pkgs.callPackage ./nix/serve_app.nix {
inherit sources backendConfigDir listen pidfile;
inherit (vars) compileWebclient;
};
in serveApp