Closer to 'correct' backplane-dns-server
This commit is contained in:
parent
96da822c5a
commit
f442ea729c
|
@ -4,6 +4,54 @@ with lib;
|
|||
let
|
||||
cfg = config.fudo.backplane.dns;
|
||||
|
||||
lisp-pkgs = with pkgs.localLispPackages; [
|
||||
arrows
|
||||
backplane-dns
|
||||
backplane-server
|
||||
cl-sasl
|
||||
cl-xmpp
|
||||
ip-utils
|
||||
|
||||
alexandria
|
||||
babel
|
||||
bordeaux-threads
|
||||
cffi
|
||||
cl-base64
|
||||
cl-json
|
||||
cl-postgres
|
||||
cl-ppcre
|
||||
cl-unicode
|
||||
cl_plus_ssl
|
||||
closer-mop
|
||||
closure-common
|
||||
cxml
|
||||
flexi-streams
|
||||
global-vars
|
||||
introspect-environment
|
||||
ironclad
|
||||
iterate
|
||||
lisp-namespace
|
||||
md5
|
||||
nibbles
|
||||
postmodern
|
||||
puri
|
||||
s-sql
|
||||
split-sequence
|
||||
trivia
|
||||
trivia_dot_balland2006
|
||||
trivia_dot_level0
|
||||
trivia_dot_level1
|
||||
trivia_dot_level2
|
||||
trivia_dot_trivial
|
||||
trivial-cltl2
|
||||
trivial-features
|
||||
trivial-garbage
|
||||
trivial-gray-streams
|
||||
type-i
|
||||
uax-15
|
||||
usocket
|
||||
];
|
||||
|
||||
backup-directory = "/var/lib/fudo/backplane/dns";
|
||||
|
||||
powerdns-home = "/var/lib/powerdns";
|
||||
|
@ -32,6 +80,12 @@ let
|
|||
type = with types; submodule databaseOpts;
|
||||
description = "Database settings for backplane server.";
|
||||
};
|
||||
|
||||
cl-wrapper-package = mkOption {
|
||||
type = types.package;
|
||||
description = "Common Lisp wrapper package to use.";
|
||||
default = pkgs.lispPackages.clwrapper;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -61,15 +115,6 @@ let
|
|||
};
|
||||
};
|
||||
|
||||
lisp-libs = [];
|
||||
|
||||
launchScript = pkgs.writeText "launch-backplane-dns.lisp" ''
|
||||
(load (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname)))
|
||||
(ql:quickload :backplane-dns)
|
||||
(backplane-dns:start-listener-with-env)
|
||||
(loop (sleep 600))
|
||||
'';
|
||||
|
||||
in {
|
||||
options.fudo.backplane.dns = {
|
||||
enable = mkEnableOption "Enable backplane dynamic DNS server.";
|
||||
|
@ -251,8 +296,7 @@ in {
|
|||
restartIfChanged = true;
|
||||
|
||||
serviceConfig = {
|
||||
ExecStartPre = "${pkgs.lispPackages.quicklisp}/bin/quicklisp init";
|
||||
ExecStart = "${pkgs.sbcl}/bin/sbcl --load ${launchScript}";
|
||||
ExecStart = "${pkgs.backplane-dns-server}/bin/launch-backplane-dns.sh";
|
||||
Restart = "on-failure";
|
||||
PIDFile = "/run/backplane-dns.$USERNAME.pid";
|
||||
User = cfg.user;
|
||||
|
@ -260,7 +304,7 @@ in {
|
|||
};
|
||||
|
||||
environment = {
|
||||
LD_LIBRARY_PATH = "${pkgs.openssl_1_1.out}/lib";
|
||||
# LD_LIBRARY_PATH = "${pkgs.openssl_1_1.out}/lib";
|
||||
|
||||
FUDO_DNS_BACKPLANE_XMPP_HOSTNAME = cfg.backplane.host;
|
||||
FUDO_DNS_BACKPLANE_XMPP_USERNAME = cfg.backplane.role;
|
||||
|
@ -270,8 +314,10 @@ in {
|
|||
FUDO_DNS_BACKPLANE_DATABASE_USERNAME = cfg.backplane.database.username;
|
||||
FUDO_DNS_BACKPLANE_DATABASE_PASSWORD_FILE = cfg.backplane.database.password-file;
|
||||
|
||||
# CL_SOURCE_REGISTRY = "${pkgs.localLispPackages.backplane-dns}//";
|
||||
|
||||
CL_SOURCE_REGISTRY = lib.concatStringsSep ":" (map (pkg: "${pkg}//")
|
||||
(lisp-libs ++ [pkgs.backplane-dns]));
|
||||
lisp-pkgs);
|
||||
};
|
||||
|
||||
requires = cfg.required-services;
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
{ pkgs, localLispPackages, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
let
|
||||
launcher = pkgs.writeText "launch-backplane-dns.lisp" ''
|
||||
(require :asdf)
|
||||
(asdf:load-system :backplane-dns)
|
||||
(backplane-dns:start-listener-with-env)
|
||||
(loop (sleep 600))
|
||||
'';
|
||||
|
||||
launcherScript = pkgs.writeShellScriptBin "launch-backplane-dns.sh" ''
|
||||
${pkgs.lispPackages.clwrapper}/bin/common-lisp.sh --load ${launcher}
|
||||
'';
|
||||
|
||||
in pkgs.stdenv.mkDerivation {
|
||||
pname = "backplane-dns-server";
|
||||
version = "0.1.0";
|
||||
|
||||
propagatedBuildInputs = with pkgs; [
|
||||
asdf
|
||||
sbcl
|
||||
lispPackages.clwrapper
|
||||
localLispPackages.backplane-dns
|
||||
];
|
||||
|
||||
phases = [ "installPhase" ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p "$out/bin"
|
||||
cp ${launcherScript}/bin/launch-backplane-dns.sh "$out/bin"
|
||||
'';
|
||||
}
|
|
@ -65,11 +65,11 @@ in {
|
|||
inherit (pkgs) stdenv fetchurl makeWrapper cups dpkg a2ps ghostscript gnugrep gnused coreutils file perl which;
|
||||
};
|
||||
|
||||
backplane-dns = import ./backplane-dns.nix {
|
||||
pkgs = pkgs;
|
||||
stdenv = pkgs.stdenv;
|
||||
fetchgit = pkgs.fetchgit;
|
||||
};
|
||||
# backplane-dns = import ./backplane-dns.nix {
|
||||
# pkgs = pkgs;
|
||||
# stdenv = pkgs.stdenv;
|
||||
# fetchgit = pkgs.fetchgit;
|
||||
# };
|
||||
|
||||
backplane-dns-client = import ./backplane-dns-client.nix {
|
||||
pkgs = pkgs;
|
||||
|
@ -112,9 +112,14 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
localLispPackages = import ./lisp {
|
||||
localLispPackages = (import ./lisp {
|
||||
inherit lib;
|
||||
pkgs = unstablePkgs;
|
||||
}) // unstablePkgs.lispPackages;
|
||||
|
||||
backplane-dns-server = import ./backplane-dns-server.nix {
|
||||
inherit localLispPackages;
|
||||
pkgs = unstablePkgs;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue