fudo-pkgs/pkgs/backplane-dns-server.nix

42 lines
936 B
Nix
Raw Normal View History

2021-08-30 09:45:43 -07:00
{ pkgs, localLispPackages, ... }:
with pkgs.lib;
let
2021-11-01 10:36:47 -07:00
version = "20211031";
2021-08-30 09:45:43 -07:00
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}
'';
2021-11-01 10:36:47 -07:00
sbcl-with-ssl = pkgs.sbcl.overrideAttrs (oldAttrs: rec {
buildInputs = oldAttrs.buildInputs ++ [
pkgs.openssl_1_1.dev
];
});
2021-08-30 09:45:43 -07:00
in pkgs.stdenv.mkDerivation {
pname = "backplane-dns-server";
2021-11-01 10:36:47 -07:00
version = version;
2021-08-30 09:45:43 -07:00
propagatedBuildInputs = with pkgs; [
asdf
2021-11-01 10:36:47 -07:00
sbcl-with-ssl
2021-08-30 09:45:43 -07:00
lispPackages.clwrapper
localLispPackages.backplane-dns
];
phases = [ "installPhase" ];
installPhase = ''
mkdir -p "$out/bin"
cp ${launcherScript}/bin/launch-backplane-dns.sh "$out/bin"
'';
}